Skip to content

Commit

Permalink
feat: update base_url of anthropic
Browse files Browse the repository at this point in the history
  • Loading branch information
yangenfeng committed Mar 6, 2024
1 parent 81985b3 commit 261ab38
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions libs/partners/anthropic/langchain_anthropic/chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,12 @@ def validate_environment(cls, values: Dict) -> Dict:
values.get("anthropic_api_key") or os.environ.get("ANTHROPIC_API_KEY") or ""
)
values["anthropic_api_key"] = anthropic_api_key
values["_client"] = anthropic.Client(
api_key=anthropic_api_key.get_secret_value()
)
values["_async_client"] = anthropic.AsyncClient(
api_key=anthropic_api_key.get_secret_value()
)
api_key = anthropic_api_key.get_secret_value()
api_url = values.get("anthropic_api_url")
if not api_url:
api_url = "https://api.anthropic.com"
values["_client"] = anthropic.Client(api_key=api_key, base_url=api_url)
values["_async_client"] = anthropic.AsyncClient(api_key=api_key, base_url=api_url)

Check failure on line 202 in libs/partners/anthropic/langchain_anthropic/chat_models.py

View workflow job for this annotation

GitHub Actions / cd libs/partners/anthropic / make lint #3.11

Ruff (E501)

langchain_anthropic/chat_models.py:202:89: E501 Line too long (90 > 88)
return values

def _format_params(
Expand Down

0 comments on commit 261ab38

Please sign in to comment.