toolrunner

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RegistryClient

type RegistryClient struct {
	BaseURL    string
	HTTPClient *http.Client
}

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

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.

Jump to

Keyboard shortcuts

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