Skip to content

Commit

Permalink
fix: removed linebreaks in prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisVLRT committed Jan 16, 2024
1 parent 7ae8b47 commit 92ec42b
Showing 1 changed file with 11 additions and 25 deletions.
36 changes: 11 additions & 25 deletions backend/rag_components/prompts.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,23 @@
condense_history = """
Given the conversation history and the following question, can you rephrase the user's question in its original \
language so that it is self-sufficient. Make sure to avoid the use of unclear pronouns.
Given the conversation history and the following question, can you rephrase the user's question in its original language so that it is self-sufficient. You are presented with a conversation that may contain some spelling mistakes and grammatical errors, but your goal is to understand the underlying question. Make sure to avoid the use of unclear pronouns.
Chat history :
{chat_history}
Question : {question}
Chat history: {chat_history}
Rephrased question :
"""
If the question is already self-sufficient, return the original question. If it seem the user is authorizing the chatbot to answer without specific context, make sure to reflect that in the rephrased question.
Question: {question}
rag_system_prompt = """
As a chatbot assistant, your mission is to respond to user inquiries in a precise and concise manner based on \
the documents provided as input.
It is essential to respond in the same language in which the question was asked. Responses must be written in \
a professional style and must demonstrate great attention to detail.
Rephrased question:
"""

respond_to_question = """
As a chatbot assistant, your mission is to respond to user inquiries in a precise and concise manner based on \
the documents provided as input.
It is essential to respond in the same language in which the question was asked. Responses must be written in \
a professional style and must demonstrate great attention to detail.
Respond to the question taking into account the following context.
{context}
As a chatbot assistant, your mission is to respond to user inquiries in a precise and concise manner based on the documents provided as input. It is essential to respond in the same language in which the question was asked. Responses must be written in a professional style and must demonstrate great attention to detail. You must sift through various sources of information, disregarding any data that is not relevant to the query's context. Your response should integrate knowledge from the valid sources you have identified. Additionally, the question might include hypothetical or counterfactual statements. You need to recognize these and adjust your response to provide accurate, relevant information without being misled by the counterfactuals.
Question: {question}
"""
document_context = """
Content: {page_content}
Respond to the question only taking into account the following documents. If no documents are provided, refrain from answering although you may provide an answer if the user explicitely asked for a general answer. You may ask the user to rephrase their question, or their permission to answer without specific documents from your own knowledge.
Documents: {context}
Source: {source}
Response:
"""

0 comments on commit 92ec42b

Please sign in to comment.