Documentation
¶
Overview ¶
Package agent implements the agent loop: prompt assembly, model calls, tool iteration, and reply.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent runs the prompt → model → (tools) → reply loop.
func (*Agent) Handle ¶
Handle is a channel.Handler: assemble prompt, call model (with tools), return reply.
func (*Agent) SetPersona ¶ added in v0.0.2
SetPersona replaces the system persona text (e.g. after SIGHUP reload). When memory is enabled, the persona-precedence note is appended.
type History ¶
type History interface {
Messages(ctx context.Context, sessionID string) ([]session.Message, error)
Append(ctx context.Context, sessionID string, msgs ...session.Message) error
Reset(ctx context.Context, sessionID string) error
Stats(ctx context.Context, sessionID string) (messages int, estTokens int, err error)
Summary(ctx context.Context, sessionID string) (string, error)
}
History is the session-backed conversation store used by the agent.
type Options ¶
type Options struct {
Persona string
Completer provider.Completer
Sessions History
Tools Tools // optional
Memory memory.Memory // optional; hydration + persona precedence note
Model string
MaxToolIters int
StreamReplies bool // stream final text via channel.ReplyWriter when Completer is a Streamer
Logger *slog.Logger
StartedAt time.Time
}
Options configures the agent.
Click to show internal directories.
Click to hide internal directories.