agent

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithOutputDimensionality added in v0.1.0

func WithOutputDimensionality(dim uint) opt.Opt

WithOutputDimensionality sets the output dimensionality for embedding requests

func WithTaskType added in v0.1.0

func WithTaskType(taskType string) opt.Opt

WithTaskType sets the task type for embedding requests

func WithTitle added in v0.1.0

func WithTitle(title string) opt.Opt

WithTitle sets the title for the agent, which may be used in 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 NewManager(opts ...Opt) (*Manager, error)

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) Close added in v0.1.0

func (m *Manager) Close() error

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

func (m *Manager) DeleteSession(ctx context.Context, session string) (*schema.Session, error)

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) GetModel added in v0.1.0

func (m *Manager) GetModel(ctx context.Context, req schema.GetModelRequest) (*schema.Model, error)

func (*Manager) GetSession added in v0.1.0

func (m *Manager) GetSession(ctx context.Context, session string) (*schema.Session, error)

GetSession retrieves a session by ID.

func (*Manager) GetTool added in v0.1.0

func (m *Manager) GetTool(_ context.Context, name string) (*schema.ToolMeta, error)

GetTool returns tool metadata by name.

func (*Manager) ListModels added in v0.1.0

func (*Manager) ListSessions added in v0.1.0

ListSessions returns sessions with pagination support.

func (*Manager) ListTools added in v0.1.0

ListTools returns paginated tool metadata.

func (*Manager) UpdateSession added in v0.1.0

func (m *Manager) UpdateSession(ctx context.Context, id string, meta schema.SessionMeta) (*schema.Session, error)

UpdateSession updates a session's metadata. If Model or Provider are changed, they are validated against the registered providers first.

type Opt added in v0.1.0

type Opt func(*Manager) error

Opt is a functional option for configuring an agent

func WithClient added in v0.1.0

func WithClient(client llm.Client) Opt

WithClient adds an LLM client to the agent

func WithSessionStore added in v0.1.0

func WithSessionStore(store schema.Store) Opt

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

func WithToolkit(toolkit *tool.Toolkit) Opt

WithToolkit sets the toolkit for the manager.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL