Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RegistryClient ¶
RegistryClient communicates with the OpenBotStack Tool Registry.
func NewRegistryClient ¶
func NewRegistryClient(baseURL string) *RegistryClient
NewRegistryClient creates a new registry client.
func (*RegistryClient) Invoke ¶
func (c *RegistryClient) Invoke(ctx *ToolContext, toolName string, arguments map[string]any) ([]byte, error)
Invoke calls a tool and returns the response bytes.
type RegistryToolRunner ¶
type RegistryToolRunner struct {
// contains filtered or unexported fields
}
RegistryToolRunner implements ToolRunner by invoking tools from a registry.
func NewRegistryToolRunner ¶
func NewRegistryToolRunner(client *RegistryClient) *RegistryToolRunner
NewRegistryToolRunner creates a new tool runner.
func (*RegistryToolRunner) Execute ¶
func (r *RegistryToolRunner) Execute(ctx context.Context, name string, input map[string]any, ec *execution.ExecutionContext) (*execution.StepResult, error)
Execute implements ToolRunner.
type ToolContext ¶
type ToolContext struct {
context.Context
TenantID string
UserID string
RequestID string
StartTime time.Time
}
ToolContext provides the environment for a tool to execute.
func NewToolContext ¶
func NewToolContext(ctx context.Context, ec *execution.ExecutionContext) *ToolContext
NewToolContext creates a new tool context from an execution context.
func (*ToolContext) Duration ¶
func (c *ToolContext) Duration() time.Duration
Duration returns the time elapsed since the context was created.
func (*ToolContext) ExecutionContext ¶
func (c *ToolContext) ExecutionContext() context.Context
ExecutionContext returns the underlying context.
type ToolRunner ¶
type ToolRunner interface {
// Execute runs a tool with the given input.
Execute(ctx context.Context, name string, input map[string]any, ec *execution.ExecutionContext) (*execution.StepResult, error)
}
ToolRunner executes external tools.
Click to show internal directories.
Click to hide internal directories.