Documentation
¶
Index ¶
- Constants
- Variables
- func AllToolsWithBasePath(basePath string) []tool.BaseTool
- func ApplyLocalModelRuntimeMode(provider, model, mode string) error
- func CanParallelize(call1, call2 ToolCall) bool
- func GenerateImage(ctx context.Context, model types.ModelConfig, request ImageGenerationRequest) (string, error)
- func GeneratedImageHandler(w http.ResponseWriter, r *http.Request)
- func GeneratedImagesDir() string
- func GetMaxResultCharsFromRegistry(toolName string) int
- func ToolNames() []string
- func ToolsByNamesWithBasePath(basePath string, names []string) []tool.BaseTool
- func TraceTool(t tool.BaseTool) tool.BaseTool
- func WalkGlob(root, pattern string) ([]string, error)
- type Adapter
- type AskUserQuestionTool
- type BaseTool
- type BashInput
- type BashOutput
- type BashTool
- func (t *BashTool) Getenv(key string) string
- func (t *BashTool) Info(ctx context.Context) (*schema.ToolInfo, error)
- func (t *BashTool) InvokableRun(ctx context.Context, input string, opts ...tool.Option) (string, error)
- func (t *BashTool) Setenv(key, value string)
- func (t *BashTool) ValidateInput(ctx context.Context, input string) *ValidationResult
- type EnterPlanModeInput
- type EnterPlanModeOutput
- type EnterPlanModeTool
- type ExitPlanModeInput
- type ExitPlanModeOutput
- type ExitPlanModeTool
- type FileEditInput
- type FileEditOutput
- type FileEditTool
- type FileReadInput
- type FileReadOutput
- type FileReadTool
- type FileWriteInput
- type FileWriteOutput
- type FileWriteTool
- type GlobInput
- type GlobTool
- type GrepInput
- type GrepMatch
- type GrepOutput
- type GrepTool
- type ImageGenerationRequest
- type ImageGenerationTool
- type LimitedTool
- type MatchedFiles
- type OptionalValidateTool
- type ParallelToolExecutor
- type PlanModeState
- type QuestionInput
- type QuestionOption
- type QuestionOutput
- type Registry
- func (r *Registry) CreateTool(name string, basePath string) (BaseTool, error)
- func (r *Registry) Get(name string) (ToolMeta, bool)
- func (r *Registry) GetDefaultRisk(name string) string
- func (r *Registry) GetMaxResultChars(name string) int
- func (r *Registry) GetToolInfo(name string, basePath string) (*schema.ToolInfo, error)
- func (r *Registry) IsReadOnly(name string) bool
- func (r *Registry) List() []string
- func (r *Registry) ListReadOnly() []string
- func (r *Registry) Locker() *sync.Mutex
- func (r *Registry) Register(meta ToolMeta)
- type ResultLimiter
- type SearchResult
- type SleepInput
- type SleepOutput
- type SleepTool
- type Task
- type TaskCreateInput
- type TaskCreateTool
- type TaskGetInput
- type TaskGetTool
- type TaskListInput
- type TaskListTool
- type TaskStatus
- type TaskStore
- func (s *TaskStore) CreateTask(content, owner string, blockedBy []string) (*Task, error)
- func (s *TaskStore) DeleteTask(id string) error
- func (s *TaskStore) GetTask(id string) *Task
- func (s *TaskStore) ListTasks() []*Task
- func (s *TaskStore) UpdateTask(id string, updates map[string]interface{}) (*Task, error)
- type TaskUpdateInput
- type TaskUpdateTool
- type TodoInput
- type TodoItem
- type TodoWriteTool
- type ToolCall
- type ToolInterface
- type ToolMeta
- type ToolResult
- type ToolResultLimiter
- type ValidationError
- type ValidationResult
- type VideoGenerationRequest
- type VideoGenerationResult
- type VideoGenerationTool
- type WebFetchInput
- type WebFetchOutput
- type WebFetchTool
- type WebSearchInput
- type WebSearchOutput
- type WebSearchTool
Constants ¶
const GenerateImageToolName = "GenerateImage"
const GenerateVideoToolName = "GenerateVideo"
Variables ¶
var DefaultResultLimiter = NewResultLimiter("", 200*1024)
DefaultResultLimiter 默认结果限制器 默认限制: 200KB (200 * 1024 chars)
var GlobalPlanModeState = &PlanModeState{}
GlobalPlanModeState is the global plan mode state
var GlobalRegistry = NewRegistry()
全局注册中心
Functions ¶
func AllToolsWithBasePath ¶
AllToolsWithBasePath instantiates every built-in tool bound to basePath and returns them as eino tool.BaseTool values ready for compose.ToolsNodeConfig. basePath is used as the working directory / base path for tools that operate on the filesystem or shell (Glob, Grep, Read, Edit, Write, Bash, Task*).
func ApplyLocalModelRuntimeMode ¶
ApplyLocalModelRuntimeMode applies an administrator lifecycle decision immediately.
func CanParallelize ¶
CanParallelize 检查两个工具调用是否可以并行执行 规则: 1. 两者都必须是只读工具 2. 不能访问相同的文件路径(写入冲突)
func GenerateImage ¶
func GenerateImage(ctx context.Context, model types.ModelConfig, request ImageGenerationRequest) (string, error)
GenerateImage invokes an image model directly without involving a chat model.
func GeneratedImageHandler ¶
func GeneratedImageHandler(w http.ResponseWriter, r *http.Request)
GeneratedImageHandler serves only random generated files and never lists the directory.
func GeneratedImagesDir ¶
func GeneratedImagesDir() string
func GetMaxResultCharsFromRegistry ¶
GetMaxResultCharsFromRegistry 从注册中心获取工具的最大结果限制
func ToolsByNamesWithBasePath ¶
ToolsByNamesWithBasePath instantiates only the selected built-in tools.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter 把 BaseTool 适配为 eino tool
type AskUserQuestionTool ¶
type AskUserQuestionTool struct{}
AskUserQuestionTool asks the user multiple choice questions
func NewAskUserQuestionTool ¶
func NewAskUserQuestionTool() *AskUserQuestionTool
func (*AskUserQuestionTool) InvokableRun ¶
func (*AskUserQuestionTool) ValidateInput ¶
func (t *AskUserQuestionTool) ValidateInput(ctx context.Context, input string) *ValidationResult
type BaseTool ¶
type BaseTool interface {
Info(ctx context.Context) (*schema.ToolInfo, error)
ValidateInput(ctx context.Context, input string) *ValidationResult
InvokableRun(ctx context.Context, input string, opts ...tool.Option) (string, error)
}
BaseTool 基础工具接口
type BashInput ¶
type BashInput struct {
Command string `json:"command"` // Command to execute
Timeout int `json:"timeout,omitempty"` // Timeout in seconds (default 30)
}
BashInput for bash tool
type BashOutput ¶
type BashOutput struct {
Stdout string `json:"stdout"` // Standard output
Stderr string `json:"stderr"` // Standard error
ExitCode int `json:"exit_code"` // Exit code
Duration int64 `json:"duration_ms"` // Execution duration in milliseconds
}
BashOutput for bash result
type BashTool ¶
type BashTool struct {
// contains filtered or unexported fields
}
BashTool executes bash commands
func NewBashTool ¶
func (*BashTool) InvokableRun ¶
func (*BashTool) ValidateInput ¶
func (t *BashTool) ValidateInput(ctx context.Context, input string) *ValidationResult
type EnterPlanModeInput ¶
type EnterPlanModeInput struct {
Reason string `json:"reason,omitempty"` // Reason for entering plan mode
}
EnterPlanModeInput for enter plan mode tool
type EnterPlanModeOutput ¶
EnterPlanModeOutput for enter plan mode result
type EnterPlanModeTool ¶
type EnterPlanModeTool struct {
// contains filtered or unexported fields
}
EnterPlanModeTool enters plan mode for implementation planning
func NewEnterPlanModeTool ¶
func NewEnterPlanModeTool() *EnterPlanModeTool
func (*EnterPlanModeTool) InvokableRun ¶
func (*EnterPlanModeTool) ValidateInput ¶
func (t *EnterPlanModeTool) ValidateInput(ctx context.Context, input string) *ValidationResult
type ExitPlanModeInput ¶
type ExitPlanModeInput struct {
Approved bool `json:"approved"` // Whether the plan is approved
Feedback string `json:"feedback,omitempty"` // User feedback on the plan
}
ExitPlanModeInput for exit plan mode tool
type ExitPlanModeOutput ¶
type ExitPlanModeOutput struct {
Success bool `json:"success"`
Message string `json:"message"`
CanProceed bool `json:"can_proceed"`
}
ExitPlanModeOutput for exit plan mode result
type ExitPlanModeTool ¶
type ExitPlanModeTool struct {
// contains filtered or unexported fields
}
ExitPlanModeTool exits plan mode with approval
func NewExitPlanModeTool ¶
func NewExitPlanModeTool() *ExitPlanModeTool
func (*ExitPlanModeTool) InvokableRun ¶
func (*ExitPlanModeTool) ValidateInput ¶
func (t *ExitPlanModeTool) ValidateInput(ctx context.Context, input string) *ValidationResult
type FileEditInput ¶
type FileEditInput struct {
FilePath string `json:"file_path"` // Path to file to edit
OldString string `json:"old_string"` // String to replace
NewString string `json:"new_string"` // Replacement string
}
FileEditInput for file edit tool
type FileEditOutput ¶
type FileEditOutput struct {
Success bool `json:"success"` // Whether edit was successful
NewContent string `json:"new_content"` // New file content (optional)
Replaced int `json:"replaced"` // Number of replacements made
}
FileEditOutput for file edit result
type FileEditTool ¶
type FileEditTool struct {
// contains filtered or unexported fields
}
FileEditTool performs exact string replacements in files
func NewFileEditTool ¶
func NewFileEditTool(basePath ...string) *FileEditTool
func (*FileEditTool) InvokableRun ¶
func (*FileEditTool) ValidateInput ¶
func (t *FileEditTool) ValidateInput(ctx context.Context, input string) *ValidationResult
type FileReadInput ¶
type FileReadInput struct {
FilePath string `json:"file_path"` // Path to file to read
Offset int `json:"offset,omitempty"` // Line offset to start reading from
Limit int `json:"limit,omitempty"` // Maximum number of lines to read
ShowLineNumbers bool `json:"show_line_numbers,omitempty"` // Include line numbers in output
}
FileReadInput for file read tool
type FileReadOutput ¶
type FileReadOutput struct {
Content string `json:"content"` // File content
Lines int `json:"lines"` // Number of lines read
Truncated bool `json:"truncated"` // Whether output was truncated
FullPath string `json:"full_path"` // Full resolved path
FileSize int64 `json:"file_size"` // Original file size in bytes
}
FileReadOutput for file read result
type FileReadTool ¶
type FileReadTool struct {
// contains filtered or unexported fields
}
FileReadTool reads files from the filesystem
func NewFileReadTool ¶
func NewFileReadTool(basePath ...string) *FileReadTool
func (*FileReadTool) InvokableRun ¶
func (*FileReadTool) ValidateInput ¶
func (t *FileReadTool) ValidateInput(ctx context.Context, input string) *ValidationResult
type FileWriteInput ¶
type FileWriteInput struct {
FilePath string `json:"file_path"` // Path to file to write
Content string `json:"content"` // Content to write
Append bool `json:"append,omitempty"` // Append to file instead of overwriting
}
FileWriteInput for file write tool
type FileWriteOutput ¶
type FileWriteOutput struct {
Success bool `json:"success"` // Whether write was successful
BytesWritten int64 `json:"bytes_written"` // Number of bytes written
FullPath string `json:"full_path"` // Full path to written file
}
FileWriteOutput for file write result
type FileWriteTool ¶
type FileWriteTool struct {
// contains filtered or unexported fields
}
FileWriteTool writes files to the filesystem
func NewFileWriteTool ¶
func NewFileWriteTool(basePath ...string) *FileWriteTool
func (*FileWriteTool) InvokableRun ¶
func (*FileWriteTool) ValidateInput ¶
func (t *FileWriteTool) ValidateInput(ctx context.Context, input string) *ValidationResult
type GlobInput ¶
type GlobInput struct {
Pattern string `json:"pattern"` // Glob pattern (e.g., "**/*.go")
Path string `json:"path"` // Base path to search from (optional, defaults to current directory)
}
GlobInput for glob tool
type GlobTool ¶
type GlobTool struct {
// contains filtered or unexported fields
}
GlobTool matches files by glob patterns
func NewGlobTool ¶
func (*GlobTool) InvokableRun ¶
func (*GlobTool) ValidateInput ¶
func (t *GlobTool) ValidateInput(ctx context.Context, input string) *ValidationResult
type GrepInput ¶
type GrepInput struct {
Pattern string `json:"pattern"` // Regex pattern to search
Path string `json:"path"` // Path to search in
Glob string `json:"glob,omitempty"` // File glob filter (e.g., "*.go")
Context int `json:"context,omitempty"` // Lines of context before/after
CaseSensitive bool `json:"case_sensitive,omitempty"` // Case sensitive search
Regex bool `json:"regex,omitempty"` // Treat pattern as regex (default true)
Head int `json:"head,omitempty"` // Limit number of results
Invert bool `json:"invert,omitempty"` // Invert match (like grep -v)
}
GrepInput for grep tool
type GrepMatch ¶
type GrepMatch struct {
File string `json:"file"` // File path
Line int `json:"line"` // Line number
Text string `json:"text"` // Line content
}
GrepMatch represents a single grep match
type GrepOutput ¶
type GrepOutput struct {
Matches []GrepMatch `json:"matches"`
Count int `json:"count"`
Pattern string `json:"pattern"`
Path string `json:"path"`
}
GrepOutput for grep results
type GrepTool ¶
type GrepTool struct {
// contains filtered or unexported fields
}
GrepTool searches file contents using regex
func NewGrepTool ¶
func (*GrepTool) InvokableRun ¶
func (*GrepTool) ValidateInput ¶
func (t *GrepTool) ValidateInput(ctx context.Context, input string) *ValidationResult
type ImageGenerationRequest ¶
type ImageGenerationTool ¶
type ImageGenerationTool struct {
// contains filtered or unexported fields
}
func NewImageGenerationTool ¶
func NewImageGenerationTool(model types.ModelConfig) *ImageGenerationTool
func (*ImageGenerationTool) InvokableRun ¶
type LimitedTool ¶
type LimitedTool struct {
// contains filtered or unexported fields
}
LimitedTool 带结果限制的工具包装器
func WrapToolWithLimiter ¶
func WrapToolWithLimiter(t BaseTool, limiter *ResultLimiter) *LimitedTool
WrapToolWithLimiter 包装工具,添加结果大小限制
func (*LimitedTool) InvokableRun ¶
func (*LimitedTool) ValidateInput ¶
func (t *LimitedTool) ValidateInput(ctx context.Context, input string) *ValidationResult
type MatchedFiles ¶
MatchedFiles represents the result of a glob operation
type OptionalValidateTool ¶
type OptionalValidateTool interface {
ValidateInput(ctx context.Context, input string) *ValidationResult
}
OptionalValidateTool 可选验证接口(简化工具可不实现)
type ParallelToolExecutor ¶
type ParallelToolExecutor struct {
// contains filtered or unexported fields
}
ParallelToolExecutor 并行执行工具的帮助类
func NewParallelToolExecutor ¶
func NewParallelToolExecutor(maxWorkers int) *ParallelToolExecutor
NewParallelToolExecutor 创建并行执行器
func (*ParallelToolExecutor) ExecuteParallel ¶
func (p *ParallelToolExecutor) ExecuteParallel(ctx context.Context, calls []ToolCall) []ToolResult
ExecuteParallel 并行执行多个只读工具调用 只读工具: Glob, Grep, WebSearch, WebFetch, Read (对于读取) 等 注意: 这个方法主要用于外部批量调用,对于 ADK 框架内的工具调用, 并行化需要在框架层面处理
type PlanModeState ¶
type PlanModeState struct {
// contains filtered or unexported fields
}
PlanModeState tracks plan mode state
func (*PlanModeState) Enter ¶
func (s *PlanModeState) Enter() bool
func (*PlanModeState) Exit ¶
func (s *PlanModeState) Exit() bool
func (*PlanModeState) GetPhase ¶
func (s *PlanModeState) GetPhase() string
func (*PlanModeState) IsInPlanMode ¶
func (s *PlanModeState) IsInPlanMode() bool
func (*PlanModeState) SetPhase ¶
func (s *PlanModeState) SetPhase(phase string)
type QuestionInput ¶
type QuestionInput struct {
Question string `json:"question"` // The question to ask
Options []QuestionOption `json:"options"` // Answer options
Header string `json:"header,omitempty"` // Short header for the question
MultiSelect bool `json:"multi_select"` // Allow multiple selections
}
QuestionInput for ask user question tool
type QuestionOption ¶
type QuestionOption struct {
Label string `json:"label"` // Display label
Description string `json:"description,omitempty"` // Option description
}
QuestionOption represents a single choice option
type QuestionOutput ¶
type QuestionOutput struct {
Answer string `json:"answer"` // Selected option label
Answers []string `json:"answers"` // Multiple selected labels (if multi_select)
Success bool `json:"success"` // Whether an answer was received
}
QuestionOutput for ask user question result
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry 工具注册中心
func (*Registry) CreateTool ¶
CreateTool 根据名称创建工具实例
func (*Registry) GetDefaultRisk ¶
GetDefaultRisk 获取工具的默认风险级别
func (*Registry) GetMaxResultChars ¶
GetMaxResultChars 获取工具的最大结果字符数限制
func (*Registry) GetToolInfo ¶
GetToolInfo 获取工具的 schema.ToolInfo
func (*Registry) ListReadOnly ¶
ListReadOnly 返回所有只读工具名称(可用于并行执行)
type ResultLimiter ¶
type ResultLimiter struct {
// contains filtered or unexported fields
}
ResultLimiter 工具结果大小限制器
func NewResultLimiter ¶
func NewResultLimiter(tempDir string, maxCharSize int) *ResultLimiter
NewResultLimiter 创建结果限制器 tempDir: 临时文件目录,maxCharSize: 最大字符数限制
func (*ResultLimiter) LimitResult ¶
func (r *ResultLimiter) LimitResult(result string, toolName string) (string, bool)
LimitResult 检查并限制结果大小 如果结果超过限制,写入临时文件并返回文件路径
type SearchResult ¶
type SearchResult struct {
Title string `json:"title"`
URL string `json:"url"`
Snippet string `json:"snippet"`
}
SearchResult represents a single search result
type SleepInput ¶
type SleepInput struct {
Seconds float64 `json:"seconds"` // Number of seconds to sleep
}
SleepInput for sleep tool
type SleepOutput ¶
type SleepOutput struct {
Slept float64 `json:"slept"` // Actual seconds slept
}
SleepOutput for sleep result
type SleepTool ¶
type SleepTool struct{}
SleepTool waits for a specified duration
func NewSleepTool ¶
func NewSleepTool() *SleepTool
func (*SleepTool) InvokableRun ¶
func (*SleepTool) ValidateInput ¶
func (t *SleepTool) ValidateInput(ctx context.Context, input string) *ValidationResult
type Task ¶
type Task struct {
ID string `json:"id"`
Content string `json:"content"`
Status TaskStatus `json:"status"`
Owner string `json:"owner,omitempty"`
BlockedBy []string `json:"blocked_by,omitempty"`
Blocking []string `json:"blocking,omitempty"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
CompletedAt *int64 `json:"completed_at,omitempty"`
}
Task represents a tracked task
type TaskCreateInput ¶
type TaskCreateInput struct {
Content string `json:"content"` // Task description
Owner string `json:"owner,omitempty"` // Owner of the task
BlockedBy []string `json:"blocked_by,omitempty"` // Task IDs this is blocked by
}
TaskCreateInput for task create tool
type TaskCreateTool ¶
type TaskCreateTool struct {
// contains filtered or unexported fields
}
TaskCreateTool creates a new task
func NewTaskCreateTool ¶
func NewTaskCreateTool(taskDir ...string) *TaskCreateTool
func (*TaskCreateTool) InvokableRun ¶
func (*TaskCreateTool) ValidateInput ¶
func (t *TaskCreateTool) ValidateInput(ctx context.Context, input string) *ValidationResult
type TaskGetInput ¶
type TaskGetInput struct {
ID string `json:"id"` // Task ID
}
TaskGetInput for task get tool
type TaskGetTool ¶
type TaskGetTool struct {
// contains filtered or unexported fields
}
TaskGetTool retrieves a task by ID
func NewTaskGetTool ¶
func NewTaskGetTool(taskDir ...string) *TaskGetTool
func (*TaskGetTool) InvokableRun ¶
func (*TaskGetTool) ValidateInput ¶
func (t *TaskGetTool) ValidateInput(ctx context.Context, input string) *ValidationResult
type TaskListInput ¶
type TaskListInput struct {
Status string `json:"status,omitempty"` // Filter by status
Owner string `json:"owner,omitempty"` // Filter by owner
}
TaskListInput for task list tool
type TaskListTool ¶
type TaskListTool struct {
// contains filtered or unexported fields
}
TaskListTool lists all tasks
func NewTaskListTool ¶
func NewTaskListTool(taskDir ...string) *TaskListTool
func (*TaskListTool) InvokableRun ¶
func (*TaskListTool) ValidateInput ¶
func (t *TaskListTool) ValidateInput(ctx context.Context, input string) *ValidationResult
type TaskStatus ¶
type TaskStatus string
TaskStatus represents the status of a task
const ( TaskStatusPending TaskStatus = "pending" TaskStatusInProgress TaskStatus = "in_progress" TaskStatusCompleted TaskStatus = "completed" TaskStatusCancelled TaskStatus = "cancelled" )
type TaskStore ¶
type TaskStore struct {
// contains filtered or unexported fields
}
TaskStore manages tasks in memory and optionally persists to disk
func GetTaskStore ¶
GetTaskStore returns the global task store
func (*TaskStore) CreateTask ¶
func (*TaskStore) DeleteTask ¶
type TaskUpdateInput ¶
type TaskUpdateInput struct {
ID string `json:"id"` // Task ID
Status string `json:"status,omitempty"` // New status
Owner string `json:"owner,omitempty"` // New owner
Content string `json:"content,omitempty"` // New content
}
TaskUpdateInput for task update tool
type TaskUpdateTool ¶
type TaskUpdateTool struct {
// contains filtered or unexported fields
}
TaskUpdateTool updates a task
func NewTaskUpdateTool ¶
func NewTaskUpdateTool(taskDir ...string) *TaskUpdateTool
func (*TaskUpdateTool) InvokableRun ¶
func (*TaskUpdateTool) ValidateInput ¶
func (t *TaskUpdateTool) ValidateInput(ctx context.Context, input string) *ValidationResult
type TodoInput ¶
type TodoInput struct {
Action string `json:"action"` // Action: "add", "done", "remove", "clear"
Content string `json:"content,omitempty"` // Todo content (for add)
Index int `json:"index,omitempty"` // Index (for done/remove)
Todos []map[string]string `json:"todos,omitempty"` // Full todo list (for clear)
}
TodoInput for todo write tool
type TodoWriteTool ¶
type TodoWriteTool struct {
// contains filtered or unexported fields
}
TodoWriteTool manages a simple todo list
func NewTodoWriteTool ¶
func NewTodoWriteTool(taskDir ...string) *TodoWriteTool
func (*TodoWriteTool) InvokableRun ¶
func (*TodoWriteTool) ValidateInput ¶
func (t *TodoWriteTool) ValidateInput(ctx context.Context, input string) *ValidationResult
type ToolInterface ¶
type ToolInterface interface {
Info(ctx context.Context) (*schema.ToolInfo, error)
InvokableRun(ctx context.Context, input string, opts ...tool.Option) (string, error)
}
ToolInterface is the interface all tools must implement
type ToolMeta ¶
type ToolMeta struct {
Name string
Desc string
IsReadOnly bool // 是否只读工具,可并行执行
MaxResultChars int // 最大结果字符数,超过则写入临时文件
DefaultRisk string // 默认风险级别: low, medium, high
Creator func(basePath string) interface{} // 创建工具实例的函数
}
ToolMeta 工具元信息
type ToolResult ¶
ToolResult 表示工具执行结果
type ToolResultLimiter ¶
ToolResultLimiter 接口,用于包装工具执行时限制结果大小
type ValidationError ¶
ValidationError 验证错误
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
type ValidationResult ¶
ValidationResult 验证结果
type VideoGenerationRequest ¶
type VideoGenerationResult ¶
func GenerateVideo ¶
func GenerateVideo(ctx context.Context, model types.ModelConfig, input VideoGenerationRequest) (*VideoGenerationResult, error)
GenerateVideo calls an OpenAI-compatible asynchronous video endpoint. Provider adapters can be added here without changing the public RPC.
type VideoGenerationTool ¶
type VideoGenerationTool struct {
// contains filtered or unexported fields
}
func NewVideoGenerationTool ¶
func NewVideoGenerationTool(model types.ModelConfig) *VideoGenerationTool
func (*VideoGenerationTool) InvokableRun ¶
type WebFetchInput ¶
type WebFetchInput struct {
URL string `json:"url"` // URL to fetch
Prompt string `json:"prompt"` // What to extract from the page
Cache bool `json:"cache,omitempty"` // Use cached result (default true)
}
WebFetchInput for web fetch tool
type WebFetchOutput ¶
type WebFetchOutput struct {
Content string `json:"content"` // Fetched content
Title string `json:"title,omitempty"` // Page title
StatusCode int `json:"status_code"` // HTTP status code
URL string `json:"url"` // Final URL (after redirects)
}
WebFetchOutput for web fetch result
type WebFetchTool ¶
type WebFetchTool struct {
// contains filtered or unexported fields
}
WebFetchTool fetches and analyzes web content
func NewWebFetchTool ¶
func NewWebFetchTool() *WebFetchTool
func (*WebFetchTool) InvokableRun ¶
func (*WebFetchTool) ValidateInput ¶
func (t *WebFetchTool) ValidateInput(ctx context.Context, input string) *ValidationResult
type WebSearchInput ¶
type WebSearchInput struct {
Query string `json:"query"` // Search query
Count int `json:"count,omitempty"` // Number of results (default 10)
}
WebSearchInput for web search tool
type WebSearchOutput ¶
type WebSearchOutput struct {
Results []SearchResult `json:"results"`
Query string `json:"query"`
}
WebSearchOutput for web search result
type WebSearchTool ¶
type WebSearchTool struct {
// contains filtered or unexported fields
}
WebSearchTool searches the web
func NewWebSearchTool ¶
func NewWebSearchTool() *WebSearchTool
func (*WebSearchTool) InvokableRun ¶
func (*WebSearchTool) ValidateInput ¶
func (t *WebSearchTool) ValidateInput(ctx context.Context, input string) *ValidationResult