Llm Proposition Extractor
LLM-based proposition extractor. Uses a Jinja template to extract propositions from chunks.
Custom Templates
Custom templates can include the default template and add domain-specific focus:
{% include "dice/extract_propositions.jinja" %}
FOCUS:
Extract facts about the user and the user's musical preferences:
- The user's level of knowledge about music theory
- Favorite genres, artists, and songs
- Instruments they play or want to learn
- Listening habits and contexts
...Parameters
LLM configuration
AI service for LLM calls
Template name for proposition extraction. Unless the TemplateResolver in use has been customized, this will be the path to a Jinja template under /src/main/resources/prompts. The templates should expect an object of type TemplateModel as input with name "model". The default is "dice/extract_propositions". Users can override this or use it as an example for a custom template.
Optional list of examples for few-shot prompting.
Configuration for how strictly to adhere to the schema for entities and predicates.
Number of existing propositions to show in the prompt.
Optional repository to fetch existing propositions from. When provided, existing propositions for the context will be included in the prompt to help the LLM avoid duplicates and maintain consistency.
Controls whose perspective propositions are extracted from. See ExtractionPerspective.
Constructors
Properties
Functions
Extract propositions from a chunk using LLM.
Apply entity resolution results to create final Propositions.
Convert mentions from suggested propositions to SuggestedEntities for use with the existing EntityResolver.
Set the number of existing propositions to show in prompts.
Set the extraction perspective. Controls whose facts are extracted from conversational text. See ExtractionPerspective.
Set the proposition repository to fetch existing propositions from. When provided, existing propositions for the context will be included in the prompt.
Set the schema adherence configuration.