Spaces:
Running
Running
ryanrwatkins
commited on
Commit
•
87fb0c2
1
Parent(s):
2d867b0
Update app.py
Browse files
app.py
CHANGED
@@ -453,11 +453,20 @@ def answer_template(language="english"):
|
|
453 |
</context>
|
454 |
|
455 |
Question: {{question}}
|
456 |
-
|
457 |
|
458 |
"""
|
459 |
return template
|
460 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
461 |
|
462 |
chain = ConversationalRetrievalChain.from_llm(
|
463 |
condense_question_prompt=standalone_question_prompt,
|
|
|
453 |
</context>
|
454 |
|
455 |
Question: {{question}}
|
456 |
+
Language: {language}.
|
457 |
|
458 |
"""
|
459 |
return template
|
460 |
|
461 |
+
answer_prompt = ChatPromptTemplate.from_template(answer_template())
|
462 |
+
|
463 |
+
# invoke the ChatPromptTemplate
|
464 |
+
answer_prompt.invoke(
|
465 |
+
{"question":"plaese give more details about DTC, including its use cases and implementation.",
|
466 |
+
"context":[Document(page_content="DTC use cases include...")], # the context is a list of retrieved documents.
|
467 |
+
"chat_history":memory.chat_memory}
|
468 |
+
)
|
469 |
+
|
470 |
|
471 |
chain = ConversationalRetrievalChain.from_llm(
|
472 |
condense_question_prompt=standalone_question_prompt,
|