Find answers from the community

Updated 3 months ago

If I ask "Why is the sky blue" to a

If I ask "Why is the sky blue" to a index of a pdf of insurance data, I assume it should respond with something like "That information isn't in the provided context", but instead the response still includes info about Raliegh scattering
L
O
R
8 comments
What chat engine are you using? The default? There are many, and some don't have any prompt template
index.as_chat_engine(..., system_prompt="...") is probably the solution though
is there a good system_prompt to use for document querying?
Its totally up to you and your data and use case tbh
which is why there is no default, its pretty unique for each user generally
Ok. For anyone curious, I currently using this:
Plain Text
system_prompt = (
  "Context information is below.\n"
  "---------------------\n"
  "{context_str}\n"
  "---------------------\n"
  "Given the context information and not prior knowledge, "
  "answer the question: {query_str}\n"
  "If the question is unanswerable, please respond with 'I don't know'."
)
try pass in chat_mode='context' in case not fixed
Add a reply
Sign up and join the conversation on Discord