Documentation
¶
Index ¶
- type APICallerRuntimeTool
- type APICallerTool
- func (t *APICallerTool) ArgsSchema() string
- func (t *APICallerTool) Batch(ctx context.Context, inputs []*interfaces.ToolInput) ([]*interfaces.ToolOutput, error)
- func (t *APICallerTool) Description() string
- func (t *APICallerTool) Execute(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
- func (t *APICallerTool) Invoke(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
- func (t *APICallerTool) Name() string
- func (t *APICallerTool) Pipe(next agentcore.Runnable[*interfaces.ToolOutput, any]) agentcore.Runnable[*interfaces.ToolInput, any]
- func (t *APICallerTool) Stream(ctx context.Context, input *interfaces.ToolInput) (<-chan agentcore.StreamChunk[*interfaces.ToolOutput], error)
- func (t *APICallerTool) WithCallbacks(callbacks ...agentcore.Callback) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
- func (t *APICallerTool) WithConfig(config agentcore.RunnableConfig) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
- type DatabaseQueryRuntimeTool
- type DatabaseQueryTool
- func (t *DatabaseQueryTool) ArgsSchema() string
- func (t *DatabaseQueryTool) Batch(ctx context.Context, inputs []*interfaces.ToolInput) ([]*interfaces.ToolOutput, error)
- func (t *DatabaseQueryTool) Close() error
- func (t *DatabaseQueryTool) Description() string
- func (t *DatabaseQueryTool) Execute(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
- func (t *DatabaseQueryTool) Invoke(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
- func (t *DatabaseQueryTool) Name() string
- func (t *DatabaseQueryTool) Pipe(next agentcore.Runnable[*interfaces.ToolOutput, any]) agentcore.Runnable[*interfaces.ToolInput, any]
- func (t *DatabaseQueryTool) Stream(ctx context.Context, input *interfaces.ToolInput) (<-chan agentcore.StreamChunk[*interfaces.ToolOutput], error)
- func (t *DatabaseQueryTool) WithCallbacks(callbacks ...agentcore.Callback) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
- func (t *DatabaseQueryTool) WithConfig(config agentcore.RunnableConfig) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
- type FileCompressionTool
- func (t *FileCompressionTool) ArgsSchema() string
- func (t *FileCompressionTool) Batch(ctx context.Context, inputs []*interfaces.ToolInput) ([]*interfaces.ToolOutput, error)
- func (t *FileCompressionTool) Description() string
- func (t *FileCompressionTool) Execute(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
- func (t *FileCompressionTool) Invoke(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
- func (t *FileCompressionTool) Name() string
- func (t *FileCompressionTool) Pipe(next agentcore.Runnable[*interfaces.ToolOutput, any]) agentcore.Runnable[*interfaces.ToolInput, any]
- func (t *FileCompressionTool) Stream(ctx context.Context, input *interfaces.ToolInput) (<-chan agentcore.StreamChunk[*interfaces.ToolOutput], error)
- func (t *FileCompressionTool) WithCallbacks(callbacks ...agentcore.Callback) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
- func (t *FileCompressionTool) WithConfig(config agentcore.RunnableConfig) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
- type FileManagementTool
- func (t *FileManagementTool) ArgsSchema() string
- func (t *FileManagementTool) Batch(ctx context.Context, inputs []*interfaces.ToolInput) ([]*interfaces.ToolOutput, error)
- func (t *FileManagementTool) Description() string
- func (t *FileManagementTool) Execute(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
- func (t *FileManagementTool) Invoke(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
- func (t *FileManagementTool) Name() string
- func (t *FileManagementTool) Pipe(next agentcore.Runnable[*interfaces.ToolOutput, any]) agentcore.Runnable[*interfaces.ToolInput, any]
- func (t *FileManagementTool) Stream(ctx context.Context, input *interfaces.ToolInput) (<-chan agentcore.StreamChunk[*interfaces.ToolOutput], error)
- func (t *FileManagementTool) WithCallbacks(callbacks ...agentcore.Callback) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
- func (t *FileManagementTool) WithConfig(config agentcore.RunnableConfig) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
- type FileOperationsRuntimeTool
- type FileOperationsTool
- func (t *FileOperationsTool) ArgsSchema() string
- func (t *FileOperationsTool) Batch(ctx context.Context, inputs []*interfaces.ToolInput) ([]*interfaces.ToolOutput, error)
- func (t *FileOperationsTool) Description() string
- func (t *FileOperationsTool) Execute(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
- func (t *FileOperationsTool) Invoke(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
- func (t *FileOperationsTool) Name() string
- func (t *FileOperationsTool) Pipe(next agentcore.Runnable[*interfaces.ToolOutput, any]) agentcore.Runnable[*interfaces.ToolInput, any]
- func (t *FileOperationsTool) Stream(ctx context.Context, input *interfaces.ToolInput) (<-chan agentcore.StreamChunk[*interfaces.ToolOutput], error)
- func (t *FileOperationsTool) WithCallbacks(callbacks ...agentcore.Callback) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
- func (t *FileOperationsTool) WithConfig(config agentcore.RunnableConfig) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
- type FileReadTool
- func (t *FileReadTool) ArgsSchema() string
- func (t *FileReadTool) Batch(ctx context.Context, inputs []*interfaces.ToolInput) ([]*interfaces.ToolOutput, error)
- func (t *FileReadTool) Description() string
- func (t *FileReadTool) Execute(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
- func (t *FileReadTool) Invoke(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
- func (t *FileReadTool) Name() string
- func (t *FileReadTool) Pipe(next agentcore.Runnable[*interfaces.ToolOutput, any]) agentcore.Runnable[*interfaces.ToolInput, any]
- func (t *FileReadTool) Stream(ctx context.Context, input *interfaces.ToolInput) (<-chan agentcore.StreamChunk[*interfaces.ToolOutput], error)
- func (t *FileReadTool) WithCallbacks(callbacks ...agentcore.Callback) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
- func (t *FileReadTool) WithConfig(config agentcore.RunnableConfig) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
- type FileToolConfig
- type FileWatchTool
- func (t *FileWatchTool) ArgsSchema() string
- func (t *FileWatchTool) Batch(ctx context.Context, inputs []*interfaces.ToolInput) ([]*interfaces.ToolOutput, error)
- func (t *FileWatchTool) Description() string
- func (t *FileWatchTool) Execute(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
- func (t *FileWatchTool) Invoke(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
- func (t *FileWatchTool) Name() string
- func (t *FileWatchTool) Pipe(next agentcore.Runnable[*interfaces.ToolOutput, any]) agentcore.Runnable[*interfaces.ToolInput, any]
- func (t *FileWatchTool) Stream(ctx context.Context, input *interfaces.ToolInput) (<-chan agentcore.StreamChunk[*interfaces.ToolOutput], error)
- func (t *FileWatchTool) WithCallbacks(callbacks ...agentcore.Callback) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
- func (t *FileWatchTool) WithConfig(config agentcore.RunnableConfig) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
- type FileWriteTool
- func (t *FileWriteTool) ArgsSchema() string
- func (t *FileWriteTool) Batch(ctx context.Context, inputs []*interfaces.ToolInput) ([]*interfaces.ToolOutput, error)
- func (t *FileWriteTool) Description() string
- func (t *FileWriteTool) Execute(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
- func (t *FileWriteTool) Invoke(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
- func (t *FileWriteTool) Name() string
- func (t *FileWriteTool) Pipe(next agentcore.Runnable[*interfaces.ToolOutput, any]) agentcore.Runnable[*interfaces.ToolInput, any]
- func (t *FileWriteTool) Stream(ctx context.Context, input *interfaces.ToolInput) (<-chan agentcore.StreamChunk[*interfaces.ToolOutput], error)
- func (t *FileWriteTool) WithCallbacks(callbacks ...agentcore.Callback) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
- func (t *FileWriteTool) WithConfig(config agentcore.RunnableConfig) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
- type RateLimiter
- type ResponseCache
- type WebScraperTool
- func (t *WebScraperTool) ArgsSchema() string
- func (t *WebScraperTool) Batch(ctx context.Context, inputs []*interfaces.ToolInput) ([]*interfaces.ToolOutput, error)
- func (t *WebScraperTool) Description() string
- func (t *WebScraperTool) Execute(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
- func (t *WebScraperTool) Invoke(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
- func (t *WebScraperTool) Name() string
- func (t *WebScraperTool) Pipe(next agentcore.Runnable[*interfaces.ToolOutput, any]) agentcore.Runnable[*interfaces.ToolInput, any]
- func (t *WebScraperTool) Stream(ctx context.Context, input *interfaces.ToolInput) (<-chan agentcore.StreamChunk[*interfaces.ToolOutput], error)
- func (t *WebScraperTool) WithCallbacks(callbacks ...agentcore.Callback) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
- func (t *WebScraperTool) WithConfig(config agentcore.RunnableConfig) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
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 *interfaces.ToolInput, runtime *tools.ToolRuntime) (*interfaces.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 []*interfaces.ToolInput) ([]*interfaces.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 *interfaces.ToolInput) (*interfaces.ToolOutput, error)
Execute makes the API call
func (*APICallerTool) Invoke ¶
func (t *APICallerTool) Invoke(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
Implement Runnable interface
func (*APICallerTool) Pipe ¶
func (t *APICallerTool) Pipe(next agentcore.Runnable[*interfaces.ToolOutput, any]) agentcore.Runnable[*interfaces.ToolInput, any]
func (*APICallerTool) Stream ¶
func (t *APICallerTool) Stream(ctx context.Context, input *interfaces.ToolInput) (<-chan agentcore.StreamChunk[*interfaces.ToolOutput], error)
func (*APICallerTool) WithCallbacks ¶
func (t *APICallerTool) WithCallbacks(callbacks ...agentcore.Callback) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
func (*APICallerTool) WithConfig ¶
func (t *APICallerTool) WithConfig(config agentcore.RunnableConfig) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
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 *interfaces.ToolInput, runtime *tools.ToolRuntime) (*interfaces.ToolOutput, error)
ExecuteWithRuntime executes with runtime support
type DatabaseQueryTool ¶
type DatabaseQueryTool struct {
// contains filtered or unexported fields
}
DatabaseQueryTool executes SQL queries against various databases SECURITY NOTES: - Always use parameterized queries with the 'params' field - Table and column names cannot be parameterized - validate them separately - Consider implementing query templates or whitelists for production use - Enable query logging and monitoring for suspicious patterns
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 []*interfaces.ToolInput) ([]*interfaces.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 *interfaces.ToolInput) (*interfaces.ToolOutput, error)
Execute runs the database query
func (*DatabaseQueryTool) Invoke ¶
func (t *DatabaseQueryTool) Invoke(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
Implement Runnable interface
func (*DatabaseQueryTool) Name ¶
func (t *DatabaseQueryTool) Name() string
Name returns the tool name
func (*DatabaseQueryTool) Pipe ¶
func (t *DatabaseQueryTool) Pipe(next agentcore.Runnable[*interfaces.ToolOutput, any]) agentcore.Runnable[*interfaces.ToolInput, any]
func (*DatabaseQueryTool) Stream ¶
func (t *DatabaseQueryTool) Stream(ctx context.Context, input *interfaces.ToolInput) (<-chan agentcore.StreamChunk[*interfaces.ToolOutput], error)
func (*DatabaseQueryTool) WithCallbacks ¶
func (t *DatabaseQueryTool) WithCallbacks(callbacks ...agentcore.Callback) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
func (*DatabaseQueryTool) WithConfig ¶
func (t *DatabaseQueryTool) WithConfig(config agentcore.RunnableConfig) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
type FileCompressionTool ¶ added in v0.7.0
type FileCompressionTool struct {
// contains filtered or unexported fields
}
FileCompressionTool 处理文件压缩和解压操作
func NewFileCompressionTool ¶ added in v0.7.0
func NewFileCompressionTool(config *FileToolConfig) *FileCompressionTool
NewFileCompressionTool 创建文件压缩工具
func (*FileCompressionTool) ArgsSchema ¶ added in v0.7.0
func (t *FileCompressionTool) ArgsSchema() string
ArgsSchema 返回参数 JSON Schema
func (*FileCompressionTool) Batch ¶ added in v0.7.0
func (t *FileCompressionTool) Batch(ctx context.Context, inputs []*interfaces.ToolInput) ([]*interfaces.ToolOutput, error)
Batch 实现 Runnable 接口
func (*FileCompressionTool) Description ¶ added in v0.7.0
func (t *FileCompressionTool) Description() string
Description 返回工具描述
func (*FileCompressionTool) Execute ¶ added in v0.7.0
func (t *FileCompressionTool) Execute(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
Execute 执行文件压缩操作
func (*FileCompressionTool) Invoke ¶ added in v0.7.0
func (t *FileCompressionTool) Invoke(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
Invoke 实现 Runnable 接口
func (*FileCompressionTool) Name ¶ added in v0.7.0
func (t *FileCompressionTool) Name() string
Name 返回工具名称
func (*FileCompressionTool) Pipe ¶ added in v0.7.0
func (t *FileCompressionTool) Pipe(next agentcore.Runnable[*interfaces.ToolOutput, any]) agentcore.Runnable[*interfaces.ToolInput, any]
Pipe 实现 Runnable 接口
func (*FileCompressionTool) Stream ¶ added in v0.7.0
func (t *FileCompressionTool) Stream(ctx context.Context, input *interfaces.ToolInput) (<-chan agentcore.StreamChunk[*interfaces.ToolOutput], error)
Stream 实现 Runnable 接口
func (*FileCompressionTool) WithCallbacks ¶ added in v0.7.0
func (t *FileCompressionTool) WithCallbacks(callbacks ...agentcore.Callback) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
WithCallbacks 实现 Runnable 接口
func (*FileCompressionTool) WithConfig ¶ added in v0.7.0
func (t *FileCompressionTool) WithConfig(config agentcore.RunnableConfig) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
WithConfig 实现 Runnable 接口
type FileManagementTool ¶ added in v0.7.0
type FileManagementTool struct {
// contains filtered or unexported fields
}
FileManagementTool 处理文件管理相关操作
func NewFileManagementTool ¶ added in v0.7.0
func NewFileManagementTool(config *FileToolConfig) *FileManagementTool
NewFileManagementTool 创建文件管理工具
func (*FileManagementTool) ArgsSchema ¶ added in v0.7.0
func (t *FileManagementTool) ArgsSchema() string
ArgsSchema 返回参数 JSON Schema
func (*FileManagementTool) Batch ¶ added in v0.7.0
func (t *FileManagementTool) Batch(ctx context.Context, inputs []*interfaces.ToolInput) ([]*interfaces.ToolOutput, error)
Batch 实现 Runnable 接口
func (*FileManagementTool) Description ¶ added in v0.7.0
func (t *FileManagementTool) Description() string
Description 返回工具描述
func (*FileManagementTool) Execute ¶ added in v0.7.0
func (t *FileManagementTool) Execute(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
Execute 执行文件管理操作
func (*FileManagementTool) Invoke ¶ added in v0.7.0
func (t *FileManagementTool) Invoke(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
Invoke 实现 Runnable 接口
func (*FileManagementTool) Name ¶ added in v0.7.0
func (t *FileManagementTool) Name() string
Name 返回工具名称
func (*FileManagementTool) Pipe ¶ added in v0.7.0
func (t *FileManagementTool) Pipe(next agentcore.Runnable[*interfaces.ToolOutput, any]) agentcore.Runnable[*interfaces.ToolInput, any]
Pipe 实现 Runnable 接口
func (*FileManagementTool) Stream ¶ added in v0.7.0
func (t *FileManagementTool) Stream(ctx context.Context, input *interfaces.ToolInput) (<-chan agentcore.StreamChunk[*interfaces.ToolOutput], error)
Stream 实现 Runnable 接口
func (*FileManagementTool) WithCallbacks ¶ added in v0.7.0
func (t *FileManagementTool) WithCallbacks(callbacks ...agentcore.Callback) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
WithCallbacks 实现 Runnable 接口
func (*FileManagementTool) WithConfig ¶ added in v0.7.0
func (t *FileManagementTool) WithConfig(config agentcore.RunnableConfig) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
WithConfig 实现 Runnable 接口
type FileOperationsRuntimeTool ¶
type FileOperationsRuntimeTool struct {
*FileOperationsTool
}
FileOperationsRuntimeTool 扩展 FileOperationsTool 以支持运行时
func NewFileOperationsRuntimeTool ¶
func NewFileOperationsRuntimeTool(basePath string) *FileOperationsRuntimeTool
NewFileOperationsRuntimeTool 创建支持运行时的文件操作工具
func (*FileOperationsRuntimeTool) ExecuteWithRuntime ¶
func (t *FileOperationsRuntimeTool) ExecuteWithRuntime(ctx context.Context, input *interfaces.ToolInput, runtime *tools.ToolRuntime) (*interfaces.ToolOutput, error)
ExecuteWithRuntime 使用运行时支持执行
type FileOperationsTool ¶
type FileOperationsTool struct {
// contains filtered or unexported fields
}
FileOperationsTool 保留用于向后兼容,内部委托给专门的工具 已废弃: 请直接使用 FileReadTool, FileWriteTool, FileManagementTool, FileCompressionTool, FileWatchTool Deprecated: Use specific tools (FileReadTool, FileWriteTool, FileManagementTool, FileCompressionTool, FileWatchTool) instead
func NewFileOperationsTool ¶
func NewFileOperationsTool(basePath string) *FileOperationsTool
NewFileOperationsTool 创建文件操作工具(向后兼容) Deprecated: Use NewFileReadTool, NewFileWriteTool, etc. instead
func (*FileOperationsTool) ArgsSchema ¶
func (t *FileOperationsTool) ArgsSchema() string
ArgsSchema 返回参数 JSON Schema
func (*FileOperationsTool) Batch ¶
func (t *FileOperationsTool) Batch(ctx context.Context, inputs []*interfaces.ToolInput) ([]*interfaces.ToolOutput, error)
Batch 实现 Runnable 接口
func (*FileOperationsTool) Description ¶
func (t *FileOperationsTool) Description() string
Description 返回工具描述
func (*FileOperationsTool) Execute ¶
func (t *FileOperationsTool) Execute(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
Execute 执行文件操作(委托给专门工具)
func (*FileOperationsTool) Invoke ¶
func (t *FileOperationsTool) Invoke(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
Invoke 实现 Runnable 接口
func (*FileOperationsTool) Pipe ¶
func (t *FileOperationsTool) Pipe(next agentcore.Runnable[*interfaces.ToolOutput, any]) agentcore.Runnable[*interfaces.ToolInput, any]
Pipe 实现 Runnable 接口
func (*FileOperationsTool) Stream ¶
func (t *FileOperationsTool) Stream(ctx context.Context, input *interfaces.ToolInput) (<-chan agentcore.StreamChunk[*interfaces.ToolOutput], error)
Stream 实现 Runnable 接口
func (*FileOperationsTool) WithCallbacks ¶
func (t *FileOperationsTool) WithCallbacks(callbacks ...agentcore.Callback) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
WithCallbacks 实现 Runnable 接口
func (*FileOperationsTool) WithConfig ¶
func (t *FileOperationsTool) WithConfig(config agentcore.RunnableConfig) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
WithConfig 实现 Runnable 接口
type FileReadTool ¶ added in v0.7.0
type FileReadTool struct {
// contains filtered or unexported fields
}
FileReadTool 处理文件读取相关操作
func NewFileReadTool ¶ added in v0.7.0
func NewFileReadTool(config *FileToolConfig) *FileReadTool
NewFileReadTool 创建文件读取工具
func (*FileReadTool) ArgsSchema ¶ added in v0.7.0
func (t *FileReadTool) ArgsSchema() string
ArgsSchema 返回参数 JSON Schema
func (*FileReadTool) Batch ¶ added in v0.7.0
func (t *FileReadTool) Batch(ctx context.Context, inputs []*interfaces.ToolInput) ([]*interfaces.ToolOutput, error)
Batch 实现 Runnable 接口
func (*FileReadTool) Description ¶ added in v0.7.0
func (t *FileReadTool) Description() string
Description 返回工具描述
func (*FileReadTool) Execute ¶ added in v0.7.0
func (t *FileReadTool) Execute(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
Execute 执行文件读取操作
func (*FileReadTool) Invoke ¶ added in v0.7.0
func (t *FileReadTool) Invoke(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
Invoke 实现 Runnable 接口
func (*FileReadTool) Pipe ¶ added in v0.7.0
func (t *FileReadTool) Pipe(next agentcore.Runnable[*interfaces.ToolOutput, any]) agentcore.Runnable[*interfaces.ToolInput, any]
Pipe 实现 Runnable 接口
func (*FileReadTool) Stream ¶ added in v0.7.0
func (t *FileReadTool) Stream(ctx context.Context, input *interfaces.ToolInput) (<-chan agentcore.StreamChunk[*interfaces.ToolOutput], error)
Stream 实现 Runnable 接口
func (*FileReadTool) WithCallbacks ¶ added in v0.7.0
func (t *FileReadTool) WithCallbacks(callbacks ...agentcore.Callback) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
WithCallbacks 实现 Runnable 接口
func (*FileReadTool) WithConfig ¶ added in v0.7.0
func (t *FileReadTool) WithConfig(config agentcore.RunnableConfig) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
WithConfig 实现 Runnable 接口
type FileToolConfig ¶ added in v0.7.0
type FileToolConfig struct {
BasePath string
MaxFileSize int64
AllowedPaths []string
ForbiddenPaths []string
}
FileToolConfig 文件工具通用配置
func DefaultFileToolConfig ¶ added in v0.7.0
func DefaultFileToolConfig() *FileToolConfig
DefaultFileToolConfig 返回默认配置
type FileWatchTool ¶ added in v0.7.0
type FileWatchTool struct {
// contains filtered or unexported fields
}
FileWatchTool 处理文件监控操作
func NewFileWatchTool ¶ added in v0.7.0
func NewFileWatchTool(config *FileToolConfig) *FileWatchTool
NewFileWatchTool 创建文件监控工具
func (*FileWatchTool) ArgsSchema ¶ added in v0.7.0
func (t *FileWatchTool) ArgsSchema() string
ArgsSchema 返回参数 JSON Schema
func (*FileWatchTool) Batch ¶ added in v0.7.0
func (t *FileWatchTool) Batch(ctx context.Context, inputs []*interfaces.ToolInput) ([]*interfaces.ToolOutput, error)
Batch 实现 Runnable 接口
func (*FileWatchTool) Description ¶ added in v0.7.0
func (t *FileWatchTool) Description() string
Description 返回工具描述
func (*FileWatchTool) Execute ¶ added in v0.7.0
func (t *FileWatchTool) Execute(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
Execute 执行文件监控操作
func (*FileWatchTool) Invoke ¶ added in v0.7.0
func (t *FileWatchTool) Invoke(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
Invoke 实现 Runnable 接口
func (*FileWatchTool) Pipe ¶ added in v0.7.0
func (t *FileWatchTool) Pipe(next agentcore.Runnable[*interfaces.ToolOutput, any]) agentcore.Runnable[*interfaces.ToolInput, any]
Pipe 实现 Runnable 接口
func (*FileWatchTool) Stream ¶ added in v0.7.0
func (t *FileWatchTool) Stream(ctx context.Context, input *interfaces.ToolInput) (<-chan agentcore.StreamChunk[*interfaces.ToolOutput], error)
Stream 实现 Runnable 接口
func (*FileWatchTool) WithCallbacks ¶ added in v0.7.0
func (t *FileWatchTool) WithCallbacks(callbacks ...agentcore.Callback) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
WithCallbacks 实现 Runnable 接口
func (*FileWatchTool) WithConfig ¶ added in v0.7.0
func (t *FileWatchTool) WithConfig(config agentcore.RunnableConfig) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
WithConfig 实现 Runnable 接口
type FileWriteTool ¶ added in v0.7.0
type FileWriteTool struct {
// contains filtered or unexported fields
}
FileWriteTool 处理文件写入相关操作
func NewFileWriteTool ¶ added in v0.7.0
func NewFileWriteTool(config *FileToolConfig) *FileWriteTool
NewFileWriteTool 创建文件写入工具
func (*FileWriteTool) ArgsSchema ¶ added in v0.7.0
func (t *FileWriteTool) ArgsSchema() string
ArgsSchema 返回参数 JSON Schema
func (*FileWriteTool) Batch ¶ added in v0.7.0
func (t *FileWriteTool) Batch(ctx context.Context, inputs []*interfaces.ToolInput) ([]*interfaces.ToolOutput, error)
Batch 实现 Runnable 接口
func (*FileWriteTool) Description ¶ added in v0.7.0
func (t *FileWriteTool) Description() string
Description 返回工具描述
func (*FileWriteTool) Execute ¶ added in v0.7.0
func (t *FileWriteTool) Execute(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
Execute 执行文件写入操作
func (*FileWriteTool) Invoke ¶ added in v0.7.0
func (t *FileWriteTool) Invoke(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
Invoke 实现 Runnable 接口
func (*FileWriteTool) Pipe ¶ added in v0.7.0
func (t *FileWriteTool) Pipe(next agentcore.Runnable[*interfaces.ToolOutput, any]) agentcore.Runnable[*interfaces.ToolInput, any]
Pipe 实现 Runnable 接口
func (*FileWriteTool) Stream ¶ added in v0.7.0
func (t *FileWriteTool) Stream(ctx context.Context, input *interfaces.ToolInput) (<-chan agentcore.StreamChunk[*interfaces.ToolOutput], error)
Stream 实现 Runnable 接口
func (*FileWriteTool) WithCallbacks ¶ added in v0.7.0
func (t *FileWriteTool) WithCallbacks(callbacks ...agentcore.Callback) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
WithCallbacks 实现 Runnable 接口
func (*FileWriteTool) WithConfig ¶ added in v0.7.0
func (t *FileWriteTool) WithConfig(config agentcore.RunnableConfig) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
WithConfig 实现 Runnable 接口
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
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 []*interfaces.ToolInput) ([]*interfaces.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 *interfaces.ToolInput) (*interfaces.ToolOutput, error)
Execute runs the web scraper with ToolInput/ToolOutput
func (*WebScraperTool) Invoke ¶
func (t *WebScraperTool) Invoke(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
Implement Runnable interface
func (*WebScraperTool) Pipe ¶
func (t *WebScraperTool) Pipe(next agentcore.Runnable[*interfaces.ToolOutput, any]) agentcore.Runnable[*interfaces.ToolInput, any]
func (*WebScraperTool) Stream ¶
func (t *WebScraperTool) Stream(ctx context.Context, input *interfaces.ToolInput) (<-chan agentcore.StreamChunk[*interfaces.ToolOutput], error)
func (*WebScraperTool) WithCallbacks ¶
func (t *WebScraperTool) WithCallbacks(callbacks ...agentcore.Callback) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]
func (*WebScraperTool) WithConfig ¶
func (t *WebScraperTool) WithConfig(config agentcore.RunnableConfig) agentcore.Runnable[*interfaces.ToolInput, *interfaces.ToolOutput]