Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nfcampos committed Oct 2, 2024
1 parent 89510e7 commit e68c424
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
11 changes: 6 additions & 5 deletions python/langsmith/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,7 @@ def batch_ingest_runs(
] = None,
*,
pre_sampled: bool = False,
):
) -> None:
"""Batch ingest/upsert multiple runs in the Langsmith system.
Args:
Expand All @@ -1424,7 +1424,7 @@ def batch_ingest_runs(
Defaults to False.
Returns:
None: If both `create` and `update` are None.
None
Raises:
LangsmithAPIError: If there is an error in the API request.
Expand Down Expand Up @@ -1557,7 +1557,7 @@ def multipart_ingest_runs(
] = None,
*,
pre_sampled: bool = False,
):
) -> None:
"""Batch ingest/upsert multiple runs in the Langsmith system.
Args:
Expand All @@ -1572,7 +1572,7 @@ def multipart_ingest_runs(
Defaults to False.
Returns:
None: If both `create` and `update` are None.
None
Raises:
LangsmithAPIError: If there is an error in the API request.
Expand Down Expand Up @@ -5795,6 +5795,7 @@ def _tracing_thread_handle_batch(
_AUTO_SCALE_UP_NTHREADS_LIMIT = 16
_AUTO_SCALE_DOWN_NEMPTY_TRIGGER = 4
_BLOCKSIZE_BYTES = 1024 * 1024 # 1MB
_USE_MULTIPART = os.getenv("LANGSMITH_FF_MULTIPART") in ["1", "true"]


def _ensure_ingest_config(
Expand Down Expand Up @@ -5828,7 +5829,7 @@ def _tracing_control_thread_func(client_ref: weakref.ref[Client]) -> None:
size_limit: int = batch_ingest_config["size_limit"]
scale_up_nthreads_limit: int = batch_ingest_config["scale_up_nthreads_limit"]
scale_up_qsize_trigger: int = batch_ingest_config["scale_up_qsize_trigger"]
use_multipart = os.getenv("LANGSMITH_FF_MULTIPART") in ["1", "true"]
use_multipart = _USE_MULTIPART
# use_multipart = batch_ingest_config.get("use_multipart_endpoint", False)
# TODO replace FF with reading from batch_ingest_config

Expand Down
7 changes: 4 additions & 3 deletions python/langsmith/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ class RunBase(BaseModel):
tags: Optional[List[str]] = None
"""Tags for categorizing or annotating the run."""

attachments: Attachments = Field(default_factory=dict)
"""Attachments associated with the run.
Each entry is a tuple of (mime_type, bytes)."""

_lock: threading.Lock = PrivateAttr(default_factory=threading.Lock)

@property
Expand Down Expand Up @@ -322,9 +326,6 @@ class Run(RunBase):
""" # noqa: E501
in_dataset: Optional[bool] = None
"""Whether this run is in a dataset."""
attachments: Attachments = Field(default_factory=dict)
"""Attachments associated with the run.
Each entry is a tuple of (mime_type, bytes)."""
_host_url: Optional[str] = PrivateAttr(default=None)

def __init__(self, _host_url: Optional[str] = None, **kwargs: Any) -> None:
Expand Down

0 comments on commit e68c424

Please sign in to comment.