mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-27 08:58:48 +00:00
Update bedrock.py - support of other endpoint url (esp. for users of … (#7592)
Added an _endpoint_url_ attribute to Bedrock(LLM) class - I have access to Bedrock only via us-west-2 endpoint and needed to change the endpoint url, this could be useful to other users
This commit is contained in:
parent
22525bad65
commit
93a84f6182
@ -95,6 +95,9 @@ class Bedrock(LLM):
|
||||
model_kwargs: Optional[Dict] = None
|
||||
"""Key word arguments to pass to the model."""
|
||||
|
||||
endpoint_url: Optional[str] = None
|
||||
"""Needed if you don't want to default to us-east-1 endpoint"""
|
||||
|
||||
class Config:
|
||||
"""Configuration for this pydantic object."""
|
||||
|
||||
@ -120,6 +123,8 @@ class Bedrock(LLM):
|
||||
client_params = {}
|
||||
if values["region_name"]:
|
||||
client_params["region_name"] = values["region_name"]
|
||||
if values["endpoint_url"]:
|
||||
client_params["endpoint_url"] = values["endpoint_url"]
|
||||
|
||||
values["client"] = session.client("bedrock", **client_params)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user