Skip to content

Commit 8d54dcd

Browse files
Update the application code to reflect changes to the LangChain base class (#53)
* Update app_bedrock.py - Class Changes to LangChain * Update app_openai.py - Class Changes to LangChain * Update app_sagemaker.py - Class Changes to LangChain
1 parent 66c46d1 commit 8d54dcd

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

docker/app_bedrock.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
import streamlit as st
1414
import yaml
1515
from botocore.exceptions import ClientError
16-
from langchain import FewShotPromptTemplate, PromptTemplate, SQLDatabase
16+
from langchain.sql_database import SQLDatabase
17+
from langchain.prompts import FewShotPromptTemplate, PromptTemplate
1718
from langchain.chains.sql_database.prompt import PROMPT_SUFFIX, _postgres_prompt
1819
from langchain.embeddings.huggingface import HuggingFaceEmbeddings
1920
from langchain.llms import Bedrock

docker/app_openai.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
import streamlit as st
1818
import yaml
1919
from botocore.exceptions import ClientError
20-
from langchain import FewShotPromptTemplate, PromptTemplate, SQLDatabase
20+
from langchain.sql_database import SQLDatabase
21+
from langchain.prompts import FewShotPromptTemplate, PromptTemplate
2122
from langchain.chains.sql_database.prompt import PROMPT_SUFFIX, _postgres_prompt
2223
from langchain.chat_models import ChatOpenAI
2324
from langchain.embeddings.huggingface import HuggingFaceEmbeddings

docker/app_sagemaker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
import streamlit as st
1717
import yaml
1818
from botocore.exceptions import ClientError
19-
from langchain import FewShotPromptTemplate, PromptTemplate, SQLDatabase
19+
from langchain.sql_database import SQLDatabase
20+
from langchain.prompts import FewShotPromptTemplate, PromptTemplate
2021
from langchain.chains.sql_database.prompt import PROMPT_SUFFIX, _postgres_prompt
2122
from langchain.embeddings.huggingface import HuggingFaceEmbeddings
2223
from langchain.llms.sagemaker_endpoint import LLMContentHandler, SagemakerEndpoint

0 commit comments

Comments
 (0)