Skip to content

Commit

Permalink
defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
isahers1 committed Dec 9, 2024
1 parent 887782e commit 66228e8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions python/langsmith/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3580,7 +3580,7 @@ def _prepate_multipart_data(
def upload_examples_multipart(
self,
*,
uploads: List[ls_schemas.ExampleUploadWithAttachments] = [],
uploads: List[ls_schemas.ExampleUploadWithAttachments] = None,
) -> ls_schemas.UpsertExamplesResponse:
"""Upload examples."""
if not (self.info.instance_flags or {}).get(
Expand All @@ -3589,7 +3589,8 @@ def upload_examples_multipart(
raise ValueError(
"Your LangSmith version does not allow using the multipart examples endpoint, please update to the latest version."
)

if uploads is None:
uploads = []
encoder, data = self._prepate_multipart_data(uploads, include_dataset_id=False)
dataset_ids = set([example.dataset_id for example in uploads])
if len(dataset_ids) > 1:
Expand All @@ -3613,7 +3614,7 @@ def upload_examples_multipart(
def upsert_examples_multipart(
self,
*,
upserts: List[ls_schemas.ExampleUpsertWithAttachments] = [],
upserts: List[ls_schemas.ExampleUpsertWithAttachments] = None,
) -> ls_schemas.UpsertExamplesResponse:
"""Upsert examples.
Expand All @@ -3627,6 +3628,8 @@ def upsert_examples_multipart(
raise ValueError(
"Your LangSmith version does not allow using the multipart examples endpoint, please update to the latest version."
)
if upserts is None:
upserts = []

encoder, data = self._prepate_multipart_data(upserts, include_dataset_id=True)

Expand Down

0 comments on commit 66228e8

Please sign in to comment.