practical

package
v0.0.0-...-52ac860 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APICallerRuntimeTool

type APICallerRuntimeTool struct {
	*APICallerTool
}

APICallerRuntimeTool extends APICallerTool with runtime support

func NewAPICallerRuntimeTool

func NewAPICallerRuntimeTool() *APICallerRuntimeTool

NewAPICallerRuntimeTool creates a runtime-aware API caller

func (*APICallerRuntimeTool) ExecuteWithRuntime

func (t *APICallerRuntimeTool) ExecuteWithRuntime(ctx context.Context, input *tools.ToolInput, runtime *tools.ToolRuntime) (*tools.ToolOutput, error)

ExecuteWithRuntime executes with runtime support

type APICallerTool

type APICallerTool struct {
	// contains filtered or unexported fields
}

APICallerTool makes HTTP API calls with authentication and retry logic

func NewAPICallerTool

func NewAPICallerTool() *APICallerTool

NewAPICallerTool creates a new API caller tool

func (*APICallerTool) ArgsSchema

func (t *APICallerTool) ArgsSchema() string

ArgsSchema returns the arguments schema as a JSON string

func (*APICallerTool) Batch

func (t *APICallerTool) Batch(ctx context.Context, inputs []*tools.ToolInput) ([]*tools.ToolOutput, error)

func (*APICallerTool) Description

func (t *APICallerTool) Description() string

Description returns the tool description

func (*APICallerTool) Execute

func (t *APICallerTool) Execute(ctx context.Context, input *tools.ToolInput) (*tools.ToolOutput, error)

Execute makes the API call

func (*APICallerTool) Invoke

func (t *APICallerTool) Invoke(ctx context.Context, input *tools.ToolInput) (*tools.ToolOutput, error)

Implement Runnable interface

func (*APICallerTool) Name

func (t *APICallerTool) Name() string

Name returns the tool name

func (*APICallerTool) Pipe

func (*APICallerTool) Stream

func (*APICallerTool) WithCallbacks

func (t *APICallerTool) WithCallbacks(callbacks ...agentcore.Callback) agentcore.Runnable[*tools.ToolInput, *tools.ToolOutput]

func (*APICallerTool) WithConfig

type DatabaseQueryRuntimeTool

type DatabaseQueryRuntimeTool struct {
	*DatabaseQueryTool
}

DatabaseQueryRuntimeTool extends DatabaseQueryTool with runtime support

func NewDatabaseQueryRuntimeTool

func NewDatabaseQueryRuntimeTool() *DatabaseQueryRuntimeTool

NewDatabaseQueryRuntimeTool creates a runtime-aware database query tool

func (*DatabaseQueryRuntimeTool) ExecuteWithRuntime

func (t *DatabaseQueryRuntimeTool) ExecuteWithRuntime(ctx context.Context, input *tools.ToolInput, runtime *tools.ToolRuntime) (*tools.ToolOutput, error)

ExecuteWithRuntime executes with runtime support

type DatabaseQueryTool

type DatabaseQueryTool struct {
	// contains filtered or unexported fields
}

DatabaseQueryTool executes SQL queries against various databases

func NewDatabaseQueryTool

func NewDatabaseQueryTool() *DatabaseQueryTool

NewDatabaseQueryTool creates a new database query tool

func (*DatabaseQueryTool) ArgsSchema

func (t *DatabaseQueryTool) ArgsSchema() string

ArgsSchema returns the arguments schema as a JSON string

func (*DatabaseQueryTool) Batch

func (t *DatabaseQueryTool) Batch(ctx context.Context, inputs []*tools.ToolInput) ([]*tools.ToolOutput, error)

func (*DatabaseQueryTool) Close

func (t *DatabaseQueryTool) Close() error

Close closes all database connections

func (*DatabaseQueryTool) Description

func (t *DatabaseQueryTool) Description() string

Description returns the tool description

func (*DatabaseQueryTool) Execute

func (t *DatabaseQueryTool) Execute(ctx context.Context, input *tools.ToolInput) (*tools.ToolOutput, error)

Execute runs the database query

func (*DatabaseQueryTool) Invoke

Implement Runnable interface

func (*DatabaseQueryTool) Name

func (t *DatabaseQueryTool) Name() string

Name returns the tool name

func (*DatabaseQueryTool) Pipe

func (*DatabaseQueryTool) Stream

func (*DatabaseQueryTool) WithCallbacks

func (*DatabaseQueryTool) WithConfig

type FileOperationsRuntimeTool

type FileOperationsRuntimeTool struct {
	*FileOperationsTool
}

FileOperationsRuntimeTool extends FileOperationsTool with runtime support

func NewFileOperationsRuntimeTool

func NewFileOperationsRuntimeTool(basePath string) *FileOperationsRuntimeTool

NewFileOperationsRuntimeTool creates a runtime-aware file operations tool

func (*FileOperationsRuntimeTool) ExecuteWithRuntime

func (t *FileOperationsRuntimeTool) ExecuteWithRuntime(ctx context.Context, input *tools.ToolInput, runtime *tools.ToolRuntime) (*tools.ToolOutput, error)

ExecuteWithRuntime executes with runtime support

type FileOperationsTool

type FileOperationsTool struct {
	// contains filtered or unexported fields
}

FileOperationsTool handles various file system operations

func NewFileOperationsTool

func NewFileOperationsTool(basePath string) *FileOperationsTool

NewFileOperationsTool creates a new file operations tool

func (*FileOperationsTool) ArgsSchema

func (t *FileOperationsTool) ArgsSchema() string

ArgsSchema returns the arguments schema as a JSON string

func (*FileOperationsTool) Batch

func (t *FileOperationsTool) Batch(ctx context.Context, inputs []*tools.ToolInput) ([]*tools.ToolOutput, error)

func (*FileOperationsTool) Description

func (t *FileOperationsTool) Description() string

Description returns the tool description

func (*FileOperationsTool) Execute

func (t *FileOperationsTool) Execute(ctx context.Context, input *tools.ToolInput) (*tools.ToolOutput, error)

Execute performs the file operation

func (*FileOperationsTool) Invoke

Implement Runnable interface

func (*FileOperationsTool) Name

func (t *FileOperationsTool) Name() string

Name returns the tool name

func (*FileOperationsTool) Pipe

func (*FileOperationsTool) Stream

func (*FileOperationsTool) WithCallbacks

func (*FileOperationsTool) WithConfig

type RateLimiter

type RateLimiter struct {
	// contains filtered or unexported fields
}

RateLimiter implements token bucket rate limiting

func NewRateLimiter

func NewRateLimiter(max int, interval time.Duration) *RateLimiter

NewRateLimiter creates a new rate limiter

func (*RateLimiter) Allow

func (r *RateLimiter) Allow() bool

Allow checks if a request is allowed

type ResponseCache

type ResponseCache struct {
	// contains filtered or unexported fields
}

ResponseCache implements a simple LRU cache

func NewResponseCache

func NewResponseCache(maxSize int, ttl time.Duration) *ResponseCache

NewResponseCache creates a new response cache

func (*ResponseCache) Get

func (c *ResponseCache) Get(key string) interface{}

Get retrieves a cached value

func (*ResponseCache) Set

func (c *ResponseCache) Set(key string, value interface{})

Set stores a value in cache

type WebScraperTool

type WebScraperTool struct {
	// contains filtered or unexported fields
}

WebScraperTool scrapes web pages and extracts structured data

func NewWebScraperTool

func NewWebScraperTool() *WebScraperTool

NewWebScraperTool creates a new web scraper tool

func (*WebScraperTool) ArgsSchema

func (t *WebScraperTool) ArgsSchema() string

ArgsSchema returns the arguments schema as a JSON string

func (*WebScraperTool) Batch

func (t *WebScraperTool) Batch(ctx context.Context, inputs []*tools.ToolInput) ([]*tools.ToolOutput, error)

func (*WebScraperTool) Description

func (t *WebScraperTool) Description() string

Description returns the tool description

func (*WebScraperTool) Execute

func (t *WebScraperTool) Execute(ctx context.Context, input *tools.ToolInput) (*tools.ToolOutput, error)

Execute runs the web scraper with ToolInput/ToolOutput

func (*WebScraperTool) Invoke

func (t *WebScraperTool) Invoke(ctx context.Context, input *tools.ToolInput) (*tools.ToolOutput, error)

Implement Runnable interface

func (*WebScraperTool) Name

func (t *WebScraperTool) Name() string

Name returns the tool name

func (*WebScraperTool) Pipe

func (*WebScraperTool) Stream

func (*WebScraperTool) WithCallbacks

func (t *WebScraperTool) WithCallbacks(callbacks ...agentcore.Callback) agentcore.Runnable[*tools.ToolInput, *tools.ToolOutput]

func (*WebScraperTool) WithConfig

Jump to

Keyboard shortcuts

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