Generating An Answer
When documents have been retrieved, the pipeline needs to know how to generate an answer for the initial query.
The Answer
trait
The Answer
trait is defined as follows:
The trait is also implemented for closures.
The Simple
answer
In a lot of cases, the Simple
answer might just be sufficient. It takes either a transformed context if present, or the current retrieved documents, then prompts
the LLM with the original query to generate an answer.
The prompt used is straightforward:
Built in answer generators
Name | Description | Feature Flag |
---|---|---|
Simple | Generates an answer based on a transformed context, or the documents as is |