From 15b7ea68e3a097f23116c9ea8257ca3798d66a7f Mon Sep 17 00:00:00 2001 From: William FH <13333726+hinthornw@users.noreply.github.com> Date: Thu, 22 Aug 2024 10:22:28 -0700 Subject: [PATCH] [Python] Catch on each write endpoint (#936) --- python/langsmith/client.py | 8 ++++---- python/pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python/langsmith/client.py b/python/langsmith/client.py index 4c0d378b7..9c3852666 100644 --- a/python/langsmith/client.py +++ b/python/langsmith/client.py @@ -1381,8 +1381,8 @@ def batch_ingest_runs( self._post_batch_ingest_runs(orjson.dumps(body_chunks)) def _post_batch_ingest_runs(self, body: bytes): - try: - for api_url, api_key in self._write_api_urls.items(): + for api_url, api_key in self._write_api_urls.items(): + try: self.request_with_retries( "POST", f"{api_url}/runs/batch", @@ -1396,8 +1396,8 @@ def _post_batch_ingest_runs(self, body: bytes): to_ignore=(ls_utils.LangSmithConflictError,), stop_after_attempt=3, ) - except Exception as e: - logger.warning(f"Failed to batch ingest runs: {repr(e)}") + except Exception as e: + logger.warning(f"Failed to batch ingest runs: {repr(e)}") def update_run( self, diff --git a/python/pyproject.toml b/python/pyproject.toml index 9258f3fc1..54cb2be9e 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langsmith" -version = "0.1.101" +version = "0.1.102" description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform." authors = ["LangChain "] license = "MIT"