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
pull/7607/head v0.0.231
Ducasse-Arthur 1 year ago committed by GitHub
parent 22525bad65
commit 93a84f6182
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save