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 197c092
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions python/langsmith/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,13 @@ def __init__(
else:
self.tracing_queue = None

# Mount the HTTPAdapter with the retry configuration
# Mount the HTTPAdapter with the retry configuration.
adapter = requests_adapters.HTTPAdapter(max_retries=self.retry_config)
self.session.mount("http://", adapter)
self.session.mount("https://", adapter)
# Don't overwrite if session already has an adapter
if not self.session.get_adapter("http://"):
self.session.mount("http://", adapter)
if not self.session.get_adapter("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 197c092

Please sign in to comment.