Conversational context assembly for LLM interactions.
Summary
Functions
Assemble prompt sections with injected context entries.
Fit entries within a token budget using priority ordering.
Render a Mustache template with metadata.
Render a Mustache template with provided values.
Scan conversation history for entries that match keyword triggers.
Functions
@spec assemble_prompt(CommBus.Conversation.t(), [CommBus.Entry.t()], keyword()) :: map()
Assemble prompt sections with injected context entries.
@spec fit_budget([CommBus.Entry.t()], non_neg_integer()) :: [CommBus.Entry.t()]
Fit entries within a token budget using priority ordering.
@spec render_template(String.t(), map(), keyword()) :: {:ok, CommBus.Template.RenderResult.t()} | {:error, CommBus.Template.RenderError.t()}
Render a Mustache template with metadata.
Render a Mustache template with provided values.
@spec scan_triggers([CommBus.Message.t()], [CommBus.Entry.t()], keyword()) :: [ CommBus.Entry.t() ]
Scan conversation history for entries that match keyword triggers.