Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ from langchain.chains import create_retrieval_chain
|
|
9 |
from langchain_community.document_loaders import PyPDFLoader
|
10 |
|
11 |
# Set your API key
|
12 |
-
GOOGLE_API_KEY = "
|
13 |
|
14 |
# Load the models with the API key
|
15 |
llm = ChatGoogleGenerativeAI(model="gemini-pro", google_api_key=GOOGLE_API_KEY)
|
@@ -42,7 +42,7 @@ combine_docs_chain = create_stuff_documents_chain(llm, prompt)
|
|
42 |
retrieval_chain = create_retrieval_chain(retriever, combine_docs_chain)
|
43 |
|
44 |
# Invoke the retrieval chain
|
45 |
-
response = retrieval_chain.invoke({"input": "
|
46 |
|
47 |
# Print the answer to the question
|
48 |
print(response["answer"])
|
|
|
9 |
from langchain_community.document_loaders import PyPDFLoader
|
10 |
|
11 |
# Set your API key
|
12 |
+
GOOGLE_API_KEY = "APIKEY"
|
13 |
|
14 |
# Load the models with the API key
|
15 |
llm = ChatGoogleGenerativeAI(model="gemini-pro", google_api_key=GOOGLE_API_KEY)
|
|
|
42 |
retrieval_chain = create_retrieval_chain(retriever, combine_docs_chain)
|
43 |
|
44 |
# Invoke the retrieval chain
|
45 |
+
response = retrieval_chain.invoke({"input": "如何治療牙周病?"})
|
46 |
|
47 |
# Print the answer to the question
|
48 |
print(response["answer"])
|