Find answers from the community

Updated 2 years ago

Should the `DEFAULT REFINE PROMPT` in

Should the DEFAULT_REFINE_PROMPT in base query, rather than providing a custom template be sufficient to get a follow up query to refine an existing answer? I keep getting a response that is unrelated to the existing answer when I try --

index.query('some initial query')
--> returns an expected response

index.query('some query asking for additional information concerning response to initial query') --> returns either no context available message or completely unrelated response generated
j
O
6 comments
Hey @Omar , this is a pretty interesting use case. What index are you using? Are you putting the existing response in the query prompt for the followup question? We don't inherently have support for asking followup questions but this seems like a great thing to add.
one use case could be
  1. the user has an initial inquiry about the indexed documents
  2. the user then asks which section of the document the information was referenced (if it was not included in the first response)
@jerryjliu0 (when you get a chance πŸ™‡β€β™‚οΈ )
@Omar for that specifically you can parse response.source_nodes, which contains the documents the response came from
Ah yeah, I get that source nodes is probably sufficient for that particular use case

but it sounds like followup questions in the way that ChatGPT behaves when asked to clarify certain parts of a response is not something that is implemented just yet?
not yet! it's a good idea though, providing a good interface would require some thought on my part. in the meantime, you could think about integrating gpt index with a langchain chatbot https://github.com/jerryjliu/gpt_index/blob/main/examples/langchain_demo/LangchainDemo.ipynb
Add a reply
Sign up and join the conversation on Discord