From 66228e8af4047d27a878edd7c51c98245c2cc629 Mon Sep 17 00:00:00 2001 From: isaac hershenson Date: Mon, 9 Dec 2024 08:03:44 -0800 Subject: [PATCH] defaults --- python/langsmith/client.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python/langsmith/client.py b/python/langsmith/client.py index 4e32188e6..9fe393125 100644 --- a/python/langsmith/client.py +++ b/python/langsmith/client.py @@ -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( @@ -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: @@ -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. @@ -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)