Documentation
¶
Index ¶
- type Config
- type Option
- func WithAgents(agents ...*agent.Agent) Option
- func WithApprovalService(svc approval.Service) Option
- func WithConfig(config *Config) Option
- func WithConversionClient(client conversation.Client) Option
- func WithElicitationRouter(r elicrouter.ElicitationRouter) Option
- func WithMCPManager(m *mcpmgr.Manager) Option
- func WithMetaService(metaService *meta.Service) Option
- func WithModelConfig(providers ...*modelprovider.Config) Option
- func WithNewElicitationAwaiter(newAwaiter func() elicitation.Awaiter) Option
- func WithToolDebugLogger(w io.Writer) Option
- func WithTools(tools gtool.Registry) Option
- func WithoutHotSwap() Option
- type Service
- func (e *Service) AgentService() *agent2.Service
- func (e *Service) ApprovalService() approval.Service
- func (e *Service) Config() *Config
- func (e *Service) Conversation() *conversation.Manager
- func (e *Service) ExecuteTool(ctx context.Context, name string, args map[string]interface{}, ...) (interface{}, error)
- func (e *Service) FindToolMetadata(service, method string) []*tool.FeedSpec
- func (e *Service) IsStarted() bool
- func (e *Service) LLMCore() *core.Service
- func (e *Service) NewContext(ctx context.Context) context.Context
- func (e *Service) OAuthFinder() *oauthfinder.Finder
- func (e *Service) RegistryForConversation(convID string) tool.Registry
- func (e *Service) Shutdown(ctx context.Context)
- func (e *Service) Start(ctx context.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
BaseURL string `yaml:"baseUrl" json:"baseUrl" `
Agent *mcpcfg.Group[*agent.Agent] `yaml:"agents" json:"agents"`
Model *mcpcfg.Group[*llmprovider.Config] `yaml:"models" json:"models"`
Embedder *mcpcfg.Group[*embedderprovider.Config] `yaml:"embedders" json:"embedders" `
MCP *mcpcfg.Group[*mcpcfg.MCPClient] `yaml:"mcp" json:"mcp"`
DAOConnector *view.DBConfig `yaml:"daoConfig" json:"daoConfig" `
Default config.Defaults `yaml:"default" json:"default"`
Auth *authcfg.Config `yaml:"auth" json:"auth"`
Services []string `yaml:"services" json:"services"`
// contains filtered or unexported fields
}
func (*Config) DefaultAgentFinder ¶
func (c *Config) DefaultAgentFinder(options ...agent2.Option) *agentfinder.Finder
func (*Config) DefaultEmbedderFinder ¶
func (c *Config) DefaultEmbedderFinder() *embedderfinder.Finder
func (*Config) DefaultModelFinder ¶
func (c *Config) DefaultModelFinder() *modelfinder.Finder
type Option ¶
type Option func(config *Service)
func WithAgents ¶
WithAgents sets a custom agent registry.
func WithApprovalService ¶ added in v0.2.6
WithApprovalService sets an internal approval service implementation. Passing nil clears any existing service.
func WithConfig ¶
func WithConversionClient ¶ added in v0.2.0
func WithConversionClient(client conversation.Client) Option
func WithElicitationRouter ¶ added in v0.2.0
func WithElicitationRouter(r elicrouter.ElicitationRouter) Option
WithElicitationRouter injects a shared router used by the agent to wait on assistant-originated elicitations. In server mode, pass the same instance as the HTTP handler uses so UI callbacks unblock the agent loop.
func WithMCPManager ¶ added in v0.2.0
WithMCPManager attaches a per-conversation MCP client manager so that tool executions can inject the appropriate client/token at call time.
func WithMetaService ¶
WithMetaService sets metaService service
func WithModelConfig ¶
func WithModelConfig(providers ...*modelprovider.Config) Option
func WithNewElicitationAwaiter ¶
func WithNewElicitationAwaiter(newAwaiter func() elicitation.Awaiter) Option
WithNewElicitationAwaiter registers an interactive Awaiter responsible for resolving schema-driven user prompts ("elicitation"). When set, the awaiter is attached to the internally managed MCP client so that interactive CLI sessions can synchronously obtain the required payload.
The last non-nil value wins when the option is applied multiple times. WithNewElicitationAwaiter registers (or overrides) the Awaiter that will be used to resolve schema-based elicitation requests originating from the runtime.
Passing a non-nil Awaiter enables interactive (or otherwise custom) behaviour. Passing nil explicitly disables any previously registered Awaiter – this is useful for headless deployments such as the embedded HTTP server where blocking on stdin must be avoided.
The *last* call wins, therefore a later invocation can override an earlier one (including the implicit registration performed by the CLI helpers).
func WithToolDebugLogger ¶
WithToolDebugLogger enables debug logging for every atool call executed via the executor's atool registry. Each invocation is written to the supplied writer. Passing nil disables logging.
func WithoutHotSwap ¶
func WithoutHotSwap() Option
WithoutHotSwap disables automatic workspace hot-reload. Use this option for deterministic production runs where configuration should not change while the process is running.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) AgentService ¶
AgentService returns the registered llmagent service
func (*Service) ApprovalService ¶
ApprovalService exposes the internal approval service when present.
func (*Service) Config ¶
Config returns the underlying configuration struct (read-only). Callers must treat the returned pointer as immutable once the executor has been initialised.
func (*Service) Conversation ¶
func (e *Service) Conversation() *conversation.Manager
Conversation returns the shared conversation manager initialised by the service.
func (*Service) ExecuteTool ¶
func (e *Service) ExecuteTool(ctx context.Context, name string, args map[string]interface{}, timeout time.Duration) (interface{}, error)
ExecuteTool invokes a registered tool through the configured tool registry. It provides a lightweight way to run an individual tool without crafting a full workflow. When `timeout` is positive a child context with that deadline is used.
func (*Service) FindToolMetadata ¶ added in v0.2.1
FindToolMetadata returns ordered tool metadata (workspace extensions) that match the provided service/method combination. When none match it returns nil.
func (*Service) LLMCore ¶
LLMCore returns the underlying llm/core service instance (mainly for introspection or test hooks).
func (*Service) OAuthFinder ¶
func (e *Service) OAuthFinder() *oauthfinder.Finder
OAuthFinder exposes decrypted OAuth2 configurations loaded from workspace.
func (*Service) RegistryForConversation ¶ added in v0.2.0
RegistryForConversation returns a Registry that is scoped to the provided conversation ID. Execute calls performed through the returned registry carry the conversation identifier in context so adapters can resolve per-conv resources (e.g., MCP clients, auth tokens).