Feline.Processors.ContextAggregatorPair (feline v0.1.0-rc.1)

Copy Markdown View Source

Creates a shared context between UserContextAggregator and AssistantContextAggregator. Both aggregators read/write through the same Agent, keeping conversation history in sync.

Usage

context = Feline.Context.new([%{role: "system", content: "You are helpful."}])
{:ok, pair} = ContextAggregatorPair.start(context)

pipeline = %Pipeline{
  processor_specs: [
    {UserContextAggregator, context_agent: pair.agent},
    {StreamingLLM, api_key: "..."},
    {AssistantContextAggregator, context_agent: pair.agent}
  ]
}

Summary

Functions

append_message(agent, message)

get_context(agent)

start(context \\ Context.new())

update_context(agent, fun)