Skip to content

Commit

Permalink
add comment to unused function for future use
Browse files Browse the repository at this point in the history
  • Loading branch information
angus-langchain committed Dec 9, 2024
1 parent c1dad12 commit cc75e75
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion python/langsmith/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,15 +489,25 @@ def __init__(
# Create a session and register a finalizer to close it
session_ = session if session else requests.Session()
self.session = session_
self.compress_traces = os.getenv("LANGSMITH_COMPRESS_TRACES") == "true"
self._info = (
info
if info is None or isinstance(info, ls_schemas.LangSmithInfo)
else ls_schemas.LangSmithInfo(**info)
)
weakref.finalize(self, close_session, self.session)
atexit.register(close_session, session_)
if auto_batch_tracing and self.compress_traces:
self.tracing_queue = io.BytesIO()

threading.Thread(
target=_tracing_control_thread_func_compress, # TODO: implement
# arg must be a weakref to self to avoid the Thread object
# preventing garbage collection of the Client object
args=(weakref.ref(self),),
).start()
# Initialize auto batching
if auto_batch_tracing:
elif auto_batch_tracing:
self.tracing_queue: Optional[PriorityQueue] = PriorityQueue()

threading.Thread(
Expand Down Expand Up @@ -1752,6 +1762,7 @@ def update_run(
data["events"] = events
if data["extra"]:
self._insert_runtime_env([data])
if use_multipart and
if use_multipart and self.tracing_queue is not None:
# not collecting attachments currently, use empty dict
serialized_op = serialize_run_dict(operation="patch", payload=data)
Expand Down

0 comments on commit cc75e75

Please sign in to comment.