Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentResolver ¶ added in v0.2.1
AgentResolver resolves agent definitions by ID during runtime.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager coordinates multi-turn conversations. It keeps track of conversation history via the provided memory.History and delegates the heavy lifting to a QueryHandler.
The goal is to decouple I/O adapters (CLI, REST, WebSocket, …) from the underlying agent orchestration so that they only need to call Accept().
func New ¶
func New(handler QueryHandler, opts ...Option) *Manager
New returns a new Manager instance. If history is nil an in-memory store is created. If idGen is not supplied uuid.NewString() is used.
func (*Manager) Accept ¶
func (m *Manager) Accept(ctx context.Context, input *agentpkg.QueryInput) (*agentpkg.QueryOutput, error)
Accept processes a user query within a conversation.
- Ensures ConversationID is present (generates if empty).
- Delegates to the configured QueryHandler.
- Returns the handler's output.
type Option ¶
type Option func(*Manager)
Option allows to customise Manager behaviour.
func WithAgentResolver ¶ added in v0.2.1
func WithAgentResolver(r AgentResolver) Option
WithAgentResolver installs a resolver used by ResolveAgent.
func WithIDGenerator ¶
WithIDGenerator overrides the default conversation-ID generator.
type QueryHandler ¶
type QueryHandler func(ctx context.Context, input *agentpkg.QueryInput, output *agentpkg.QueryOutput) error
QueryHandler is a thin adapter used by the Manager to delegate the actual query processing (LLM, tool-orchestration, etc.). A production implementation would typically be a wrapper around *agent.Service, but tests can provide a lightweight stub.