mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-06 05:25:04 +00:00
DOC: Fix SageMaker example (#4598)
# Fix SageMaker example typing Since https://github.com/hwchase17/langchain/pull/3249 a new type `LLMContentHandler` is enforced for SageMaker Endpoints Fixes #4168
This commit is contained in:
@@ -93,7 +93,7 @@
|
|||||||
"from typing import Dict\n",
|
"from typing import Dict\n",
|
||||||
"\n",
|
"\n",
|
||||||
"from langchain import PromptTemplate, SagemakerEndpoint\n",
|
"from langchain import PromptTemplate, SagemakerEndpoint\n",
|
||||||
"from langchain.llms.sagemaker_endpoint import ContentHandlerBase\n",
|
"from langchain.llms.sagemaker_endpoint import LLMContentHandler\n",
|
||||||
"from langchain.chains.question_answering import load_qa_chain\n",
|
"from langchain.chains.question_answering import load_qa_chain\n",
|
||||||
"import json\n",
|
"import json\n",
|
||||||
"\n",
|
"\n",
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
" template=prompt_template, input_variables=[\"context\", \"question\"]\n",
|
" template=prompt_template, input_variables=[\"context\", \"question\"]\n",
|
||||||
")\n",
|
")\n",
|
||||||
"\n",
|
"\n",
|
||||||
"class ContentHandler(ContentHandlerBase):\n",
|
"class ContentHandler(LLMContentHandler):\n",
|
||||||
" content_type = \"application/json\"\n",
|
" content_type = \"application/json\"\n",
|
||||||
" accepts = \"application/json\"\n",
|
" accepts = \"application/json\"\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
Reference in New Issue
Block a user