Documentation
¶
Overview ¶
Package runner coordinates message exchange with the Anthropic Messages API and dispatches tool calls.
Invariant:
- tool_use and the corresponding tool_result are kept adjacent within a turn to preserve execution context and simplify follow-up reasoning.
Flow:
user(text) -> assistant(tool_use) -> user(tool_result) -> assistant(text)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runner ¶
type Runner struct {
Client *anthropic.Client
Tools []tools.ToolDefinition
}
func (*Runner) RunOneStep ¶
func (r *Runner) RunOneStep(ctx context.Context, model anthropic.Model, conv []anthropic.MessageParam) (*anthropic.Message, []anthropic.ContentBlockParamUnion, error)
RunOneStep sends the conversation and either prints text or returns tool results to be appended.
Click to show internal directories.
Click to hide internal directories.