Documentation
¶
Index ¶
- func WithOutputDimensionality(dim uint) opt.Opt
- func WithTaskType(taskType string) opt.Opt
- func WithTitle(title string) opt.Opt
- type Manager
- func (m *Manager) Ask(ctx context.Context, request schema.AskRequest, fn opt.StreamFn) (*schema.AskResponse, error)
- func (m *Manager) Chat(ctx context.Context, request schema.ChatRequest, fn opt.StreamFn) (*schema.ChatResponse, error)
- func (m *Manager) Close() error
- func (m *Manager) CreateAgent(ctx context.Context, meta schema.AgentMeta) (*schema.Agent, error)
- func (m *Manager) CreateAgentSession(ctx context.Context, id string, request schema.CreateAgentSessionRequest) (*schema.CreateAgentSessionResponse, error)
- func (m *Manager) CreateSession(ctx context.Context, meta schema.SessionMeta) (*schema.Session, error)
- func (m *Manager) DeleteAgent(ctx context.Context, id string) (*schema.Agent, error)
- func (m *Manager) DeleteSession(ctx context.Context, session string) (*schema.Session, error)
- func (m *Manager) Embedding(ctx context.Context, request *schema.EmbeddingRequest) (*schema.EmbeddingResponse, error)
- func (m *Manager) GetAgent(ctx context.Context, id string) (*schema.Agent, error)
- func (m *Manager) GetModel(ctx context.Context, req schema.GetModelRequest) (*schema.Model, error)
- func (m *Manager) GetSession(ctx context.Context, session string) (*schema.Session, error)
- func (m *Manager) GetTool(_ context.Context, name string) (*schema.ToolMeta, error)
- func (m *Manager) ListAgents(ctx context.Context, req schema.ListAgentRequest) (*schema.ListAgentResponse, error)
- func (m *Manager) ListModels(ctx context.Context, req schema.ListModelsRequest) (*schema.ListModelsResponse, error)
- func (m *Manager) ListSessions(ctx context.Context, req schema.ListSessionRequest) (*schema.ListSessionResponse, error)
- func (m *Manager) ListTools(_ context.Context, req schema.ListToolRequest) (*schema.ListToolResponse, error)
- func (m *Manager) UpdateAgent(ctx context.Context, id string, meta schema.AgentMeta) (*schema.Agent, error)
- func (m *Manager) UpdateSession(ctx context.Context, id string, meta schema.SessionMeta) (*schema.Session, error)
- type Opt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithOutputDimensionality ¶
WithOutputDimensionality sets the output dimensionality for embedding requests
func WithTaskType ¶
WithTaskType sets the task type for embedding requests
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) Ask ¶
func (m *Manager) Ask(ctx context.Context, request schema.AskRequest, fn opt.StreamFn) (*schema.AskResponse, error)
Ask processes a message and returns a response, outside of a session context (stateless). If fn is non-nil, text chunks are streamed to the callback as they arrive.
func (*Manager) Chat ¶
func (m *Manager) Chat(ctx context.Context, request schema.ChatRequest, fn opt.StreamFn) (*schema.ChatResponse, error)
Chat processes a message within a session context (stateful). If fn is non-nil, text chunks are streamed to the callback as they arrive.
func (*Manager) CreateAgent ¶
CreateAgent creates a new agent from the given metadata.
func (*Manager) CreateAgentSession ¶
func (m *Manager) CreateAgentSession(ctx context.Context, id string, request schema.CreateAgentSessionRequest) (*schema.CreateAgentSessionResponse, error)
CreateAgentSession resolves an agent by ID or name, validates input against the agent's schema, executes the agent's template, and creates a new session with merged GeneratorMeta and agent labels. If Parent is provided, the parent session's GeneratorMeta is used as defaults (agent fields take precedence). The returned response contains the session ID, rendered text, and tools, which the caller can pass to Chat.
func (*Manager) CreateSession ¶
func (m *Manager) CreateSession(ctx context.Context, meta schema.SessionMeta) (*schema.Session, error)
CreateSession creates a new session for the given model.
func (*Manager) DeleteAgent ¶
DeleteAgent deletes an agent by ID or name and returns it.
func (*Manager) DeleteSession ¶
DeleteSession deletes a session by ID and returns it.
func (*Manager) Embedding ¶
func (m *Manager) Embedding(ctx context.Context, request *schema.EmbeddingRequest) (*schema.EmbeddingResponse, error)
func (*Manager) GetSession ¶
GetSession retrieves a session by ID.
func (*Manager) ListAgents ¶
func (m *Manager) ListAgents(ctx context.Context, req schema.ListAgentRequest) (*schema.ListAgentResponse, error)
ListAgents returns agents with pagination support.
func (*Manager) ListModels ¶
func (m *Manager) ListModels(ctx context.Context, req schema.ListModelsRequest) (*schema.ListModelsResponse, error)
func (*Manager) ListSessions ¶
func (m *Manager) ListSessions(ctx context.Context, req schema.ListSessionRequest) (*schema.ListSessionResponse, error)
ListSessions returns sessions with pagination support.
func (*Manager) ListTools ¶
func (m *Manager) ListTools(_ context.Context, req schema.ListToolRequest) (*schema.ListToolResponse, error)
ListTools returns paginated tool metadata.
type Opt ¶
Opt is a functional option for configuring an agent
func WithAgentStore ¶
func WithAgentStore(store schema.AgentStore) Opt
WithAgentStore sets the agent storage backend for the manager. If not set, an in-memory store is used by default.
func WithSessionStore ¶
func WithSessionStore(store schema.SessionStore) Opt
WithSessionStore sets the session storage backend for the manager. If not set, an in-memory store is used by default.
func WithToolkit ¶
WithToolkit sets the toolkit for the manager.