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) CreateSession(ctx context.Context, meta schema.SessionMeta) (*schema.Session, 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) 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) 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) 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 ¶ added in v0.1.0
WithOutputDimensionality sets the output dimensionality for embedding requests
func WithTaskType ¶ added in v0.1.0
WithTaskType sets the task type for embedding requests
Types ¶
type Manager ¶ added in v0.1.0
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶ added in v0.1.0
func (*Manager) Ask ¶ added in v0.1.0
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 ¶ added in v0.1.0
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) CreateSession ¶ added in v0.1.0
func (m *Manager) CreateSession(ctx context.Context, meta schema.SessionMeta) (*schema.Session, error)
CreateSession creates a new session for the given model.
func (*Manager) DeleteSession ¶ added in v0.1.0
DeleteSession deletes a session by ID and returns it.
func (*Manager) Embedding ¶ added in v0.1.0
func (m *Manager) Embedding(ctx context.Context, request *schema.EmbeddingRequest) (*schema.EmbeddingResponse, error)
func (*Manager) GetSession ¶ added in v0.1.0
GetSession retrieves a session by ID.
func (*Manager) ListModels ¶ added in v0.1.0
func (m *Manager) ListModels(ctx context.Context, req schema.ListModelsRequest) (*schema.ListModelsResponse, error)
func (*Manager) ListSessions ¶ added in v0.1.0
func (m *Manager) ListSessions(ctx context.Context, req schema.ListSessionRequest) (*schema.ListSessionResponse, error)
ListSessions returns sessions with pagination support.
func (*Manager) ListTools ¶ added in v0.1.0
func (m *Manager) ListTools(_ context.Context, req schema.ListToolRequest) (*schema.ListToolResponse, error)
ListTools returns paginated tool metadata.
type Opt ¶ added in v0.1.0
Opt is a functional option for configuring an agent
func WithClient ¶ added in v0.1.0
WithClient adds an LLM client to the agent
func WithSessionStore ¶ added in v0.1.0
WithSessionStore sets the session storage backend for the manager. If not set, an in-memory store is used by default.
func WithToolkit ¶ added in v0.1.0
WithToolkit sets the toolkit for the manager.