Skip to content

Commit

Permalink
fix: add adapters if not set
Browse files Browse the repository at this point in the history
  • Loading branch information
langchain-infra committed Mar 12, 2024
1 parent 0aec28e commit 78eab21
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions python/langsmith/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,12 @@ def __init__(
else:
self.tracing_queue = None

# Mount the HTTPAdapter with the retry configuration
# Mount the HTTPAdapter with the retry configuration. Don't overwrite if session already has it
adapter = requests_adapters.HTTPAdapter(max_retries=self.retry_config)
self.session.mount("http://", adapter)
self.session.mount("https://", adapter)
if not self.session.adapters.get("http://"):
self.session.mount("http://", adapter)
if not self.session.adapters.get("https://"):
self.session.mount("https://", adapter)
self._get_data_type_cached = functools.lru_cache(maxsize=10)(
self._get_data_type
)
Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "langsmith"
version = "0.1.23"
version = "0.1.24"
description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform."
authors = ["LangChain <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 78eab21

Please sign in to comment.