Skip to content

Commit

Permalink
language
Browse files Browse the repository at this point in the history
  • Loading branch information
baptiste-pasquier committed Mar 27, 2024
1 parent 7d33b3c commit a255eb9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
21 changes: 17 additions & 4 deletions backend/rag_3/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,26 @@

TEXT_SUMMARIZATION_PROMPT = """You are an assistant tasked with summarizing text for \
retrieval. These summaries will be embedded and used to retrieve the raw text \
elements. Give a concise summary of the text that is well optimized for retrieval.
elements. Give a concise summary of the text that is well optimized for retrieval. Use \
the same language as the document.
Text:
{text}
"""

TABLE_SUMMARIZATION_PROMPT = """You are an assistant tasked with summarizing tables \
for retrieval. These summaries will be embedded and used to retrieve the raw table \
elements. Give a concise summary of the table that is well optimized for retrieval.
elements. Give a concise summary of the table that is well optimized for retrieval. \
Use the same language as the document.
Table:
{text}
"""

IMAGE_SUMMARIZATION_PROMPT = """You are an assistant tasked with summarizing images \
for retrieval. These summaries will be embedded and used to retrieve the raw image. \
Give a concise summary of the image that is well optimized for retrieval."""
Give a concise summary of the image that is well optimized for retrieval. Use the same \
language as the document."""

RAG_PROMPT = """\
RAG_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 \
Expand Down Expand Up @@ -46,3 +49,13 @@
Context:
{text}
"""

RAG_PROMPT = """You will be given a mixed of text, tables, and images usually of \
charts or graphs. Use this information to provide an answer to the user question. \
Respond in the same language in which the question was asked.
Question: {question}
Context:
{text}
"""
2 changes: 2 additions & 0 deletions backend/rag_components/chain_links/condense_question.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class StandaloneQuestion(BaseModel):
the user is authorizing the chatbot to answer without specific context, make sure to \
reflect that in the rephrased question.
Keep the same language in which the question was asked.
Chat history: {chat_history}
Question: {question}
Expand Down

0 comments on commit a255eb9

Please sign in to comment.