Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR: Analysis Questions and Grammar handling
This PR adds analysis questions to the RAG job; analysis questions allow to specify additional questions the LLM should answer following a grammar the user can select. Furthermore, we introduce the
Grammar
model, that allows to specify additional grammars besides the usual yes/no grammar.Changes
AnalysisQuestion
in therag
app. This model allows adding analysis questions to the RAG job.Question
←FilterQuestion
in therag
app. This model holds the usual rag filter questions.RagTaskProcessor
class to handle both filter- and analysis-questions.Grammar
in thechats
app. This model captures the grammar string that allows to query a specific output. Besides the grammar string, one can provide a llm_instruction that is inserted into the message sent to the LLM. Example:AsyncChatClient
now requires agrammar
argument in itsask_report_question
andask_question
methods, which allows asking a yes-or-no question or a free-text question with the same method but with different grammar arguments.CHAT_DEFAULT_GRAMMARS
variable in the base settings. This list of default grammars is added to the database oncompose-up
via thecreate_default_grammars
management command.