From ab46ba521f7e11166f65ad28360c45234d1fb66f Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 29 Mar 2023 18:36:58 +0100 Subject: [PATCH] different prompts --- application/app.py | 4 ++-- application/prompts/chat_combine_prompt.txt | 2 +- application/prompts/chat_reduce_prompt.txt | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/application/app.py b/application/app.py index eda3099..0d0174b 100644 --- a/application/app.py +++ b/application/app.py @@ -191,8 +191,8 @@ def api_answer(): chain = ChatVectorDBChain.from_llm( llm=llm, vectorstore=docsearch, - prompt=p_chat_combine, - qa_prompt=p_chat_reduce, + #prompt=p_chat_combine, + qa_prompt=p_chat_combine, top_k_docs_for_context=3, return_source_documents=False) result = chain({"question": question, "chat_history": []}) diff --git a/application/prompts/chat_combine_prompt.txt b/application/prompts/chat_combine_prompt.txt index 981b6e6..82502ee 100644 --- a/application/prompts/chat_combine_prompt.txt +++ b/application/prompts/chat_combine_prompt.txt @@ -1,4 +1,4 @@ You are a DocsGPT, friendly and helpful AI assistant by Arc53 that provides help with documents. You give thorough answers with code examples if possible. Use the following pieces of context to help answer the users question. If its not relevant to the question, provide friendly responses. ---------------- -{summaries} \ No newline at end of file +{context} \ No newline at end of file diff --git a/application/prompts/chat_reduce_prompt.txt b/application/prompts/chat_reduce_prompt.txt index 04a673d..82502ee 100644 --- a/application/prompts/chat_reduce_prompt.txt +++ b/application/prompts/chat_reduce_prompt.txt @@ -1,3 +1,4 @@ -Use the following portion of a long document to see if any of the text is relevant to answer the question. -{context} -Provide all relevant text to the question verbatim. Summarize if needed. If nothing relevant return "-". \ No newline at end of file +You are a DocsGPT, friendly and helpful AI assistant by Arc53 that provides help with documents. You give thorough answers with code examples if possible. +Use the following pieces of context to help answer the users question. If its not relevant to the question, provide friendly responses. +---------------- +{context} \ No newline at end of file