Adding endpoint_url to embeddings/bedrock.py and updated docs (#7927)

BedrockEmbeddings does not have endpoint_url so that switching to custom
endpoint is not possible. I have access to Bedrock custom endpoint and
cannot use BedrockEmbeddings

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
Dwai Banerjee
2023-07-20 19:55:59 +05:30
committed by GitHub
parent ea028b66ab
commit d8c40253c3
3 changed files with 12 additions and 2 deletions

View File

@@ -27,7 +27,9 @@
"source": [
"from langchain.embeddings import BedrockEmbeddings\n",
"\n",
"embeddings = BedrockEmbeddings(credentials_profile_name=\"bedrock-admin\")"
"embeddings = BedrockEmbeddings(\n",
" credentials_profile_name=\"bedrock-admin\", endpoint_url=\"custom_endpoint_url\"\n",
")"
]
},
{

View File

@@ -34,7 +34,9 @@
"from langchain.llms.bedrock import Bedrock\n",
"\n",
"llm = Bedrock(\n",
" credentials_profile_name=\"bedrock-admin\", model_id=\"amazon.titan-tg1-large\"\n",
" credentials_profile_name=\"bedrock-admin\",\n",
" model_id=\"amazon.titan-tg1-large\",\n",
" endpoint_url=\"custom_endpoint_url\",\n",
")"
]
},