update
Browse files
main.py
CHANGED
@@ -95,11 +95,12 @@ if llm and retriever: # Only build the chain if both LLM and retriever were succ
|
|
95 |
|
96 |
# 修改 Prompt Template
|
97 |
prompt = ChatPromptTemplate.from_messages([
|
98 |
-
("system", answer_prompt),
|
99 |
-
("user", "
|
100 |
])
|
101 |
print("Prompt Template build success.")
|
102 |
|
|
|
103 |
rag_chain = (
|
104 |
{
|
105 |
"context": retriever | format_docs,
|
|
|
95 |
|
96 |
# 修改 Prompt Template
|
97 |
prompt = ChatPromptTemplate.from_messages([
|
98 |
+
("system", answer_prompt + "\n\nContext:\n{context}"),
|
99 |
+
("user", "{question}"),
|
100 |
])
|
101 |
print("Prompt Template build success.")
|
102 |
|
103 |
+
|
104 |
rag_chain = (
|
105 |
{
|
106 |
"context": retriever | format_docs,
|