AI.Agent.Code.Common (fnord v0.9.17)
View SourceState management for code-oriented agents (planner, implementor, validator). Provides multi-turn conversation primitives and task management helpers.
This module manages its own struct and completion loop independently of
AI.Agent.Composite. The code agents use this directly rather than
implementing the Composite behaviour.
Summary
Functions
Executes a completion request. The prompt is appended as a system message,
then removed after the completion (unless keep_prompt? is true). The
assistant's response is always appended to the message history.
Creates a new state for a code agent. The initial message list contains the system prompt and the user prompt.
Types
@type t() :: %AI.Agent.Code.Common{ agent: AI.Agent.t(), error: any(), internal: map(), messages: AI.Util.msg_list(), model: AI.Model.t(), request: binary(), response: binary() | nil, toolbox: AI.Tools.toolbox() }
@type task() :: Services.Task.task()
Functions
@spec add_task(Services.Task.list_id(), new_task()) :: any()
@spec add_tasks(Services.Task.list_id(), [new_task()]) :: :ok
@spec coder_values_prompt() :: binary()
Executes a completion request. The prompt is appended as a system message,
then removed after the completion (unless keep_prompt? is true). The
assistant's response is always appended to the message history.
@spec new(AI.Agent.t(), AI.Model.t(), AI.Tools.toolbox(), binary(), binary()) :: t()
Creates a new state for a code agent. The initial message list contains the system prompt and the user prompt.