Update app.py
Browse files
app.py
CHANGED
@@ -35,11 +35,9 @@ def create_vectorstore(splits):
|
|
35 |
return retriever
|
36 |
|
37 |
def summarize_document(docs, llm):
|
38 |
-
prompt =
|
39 |
-
|
40 |
-
|
41 |
-
{context}
|
42 |
-
"""
|
43 |
chain = create_stuff_documents_chain(llm, prompt)
|
44 |
with get_openai_callback() as cb:
|
45 |
summary = chain.invoke({"context": docs})
|
|
|
35 |
return retriever
|
36 |
|
37 |
def summarize_document(docs, llm):
|
38 |
+
prompt = ChatPromptTemplate.from_messages(
|
39 |
+
[("system", "Write a concise summary of the following:\\n\\n{context}")]
|
40 |
+
)
|
|
|
|
|
41 |
chain = create_stuff_documents_chain(llm, prompt)
|
42 |
with get_openai_callback() as cb:
|
43 |
summary = chain.invoke({"context": docs})
|