From 456736a41d41a4d2733714168d95df8c4563a039 Mon Sep 17 00:00:00 2001 From: Stan Girard Date: Tue, 16 Apr 2024 22:56:32 +0200 Subject: [PATCH] feat(assistant): improve prompt summary --- backend/modules/assistant/ito/summary.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/backend/modules/assistant/ito/summary.py b/backend/modules/assistant/ito/summary.py index a1da5ff6b..90404b283 100644 --- a/backend/modules/assistant/ito/summary.py +++ b/backend/modules/assistant/ito/summary.py @@ -87,18 +87,19 @@ class SummaryAssistant(ITO): llm = ChatLiteLLM(model="gpt-3.5-turbo") - map_template = """The following is a set of documents + map_template = """The following is one document to summarize that has been split into multiple sections: {docs} - Based on this list of docs, please identify the main themes - Helpful Answer:""" + Based on the section, please identify the main themes, key points, and important information in each section. + Helpful Knowledge:""" map_prompt = PromptTemplate.from_template(map_template) map_chain = LLMChain(llm=llm, prompt=map_prompt) # Reduce - reduce_template = """The following is set of summaries: + reduce_template = """The following is set of summaries for each section of the document: {docs} - Take these and distill it into a final, consolidated summary of the main themes. - Helpful Answer:""" + Take these and distill it into a final, consolidated summary of the document. Make sure to include the main themes, key points, and important information. + Use markdown, headings, bullet points, or any other formatting to make the summary clear and easy to read. + Summary:""" reduce_prompt = PromptTemplate.from_template(reduce_template) # Run chain