Documentation
¶
Overview ¶
Package executor defines the interfaces for step executors in Axiom skills. Skills implement StepExecutor to provide custom node types.
Index ¶
Constants ¶
const FileType = "file"
FileType is the input schema type of an action input that takes a file from the chat the action runs in, written {"type": "file"} on a top-level input property. The model passes the file's path; the host hands the skill a File in its place.
const MaxFileBytes = 100 << 20
MaxFileBytes is the largest file a host hands a skill.
Variables ¶
var FileClient = &http.Client{CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}
FileClient fetches handed-over files. It never follows redirects; the caller's context bounds how long a transfer may take.
Functions ¶
This section is empty.
Types ¶
type BindingResolver ¶
type BindingResolver interface {
GetBinding(name string) interface{}
GetBindings() map[string]interface{}
}
BindingResolver is an optional interface for accessing bindings directly Skills can use this to get connection strings, API keys, etc.
type ContextProvider ¶
type ContextProvider interface {
GetContextData() map[string]interface{}
}
ContextProvider provides access to execution context data for code execution Executors that need raw context (like code executor) should check if the resolver implements this
type ExecutionGraph ¶
ExecutionGraph represents the agent execution graph
func (*ExecutionGraph) GetConnectedTools ¶
func (g *ExecutionGraph) GetConnectedTools(nodeID string) []*GraphNode
GetConnectedTools returns tool nodes connected to a specific node This is used by AI and code executors to discover available tools
type File ¶
type File struct {
Name string `json:"name"`
Path string `json:"path"`
MediaType string `json:"mediaType"`
SizeBytes int64 `json:"sizeBytes"`
URL string `json:"url"`
}
File is a chat file a host handed this skill for a file input. Only its description travels in the call; Open streams the bytes from URL, which serves this one file for a short while.
type GraphEdge ¶
type GraphEdge struct {
Id string
Source string
Target string
SourceHandle string
TargetHandle string
Label string
}
GraphEdge represents a connection between nodes
type GraphNode ¶
type GraphNode struct {
Id string
Name string
Type string
PositionX float64
PositionY float64
Config map[string]interface{}
}
GraphNode represents a node in the execution graph
type GraphProvider ¶
type GraphProvider interface {
GetGraph() *ExecutionGraph
}
GraphProvider provides access to the execution graph for executors that need it Executors like AI can use this to discover connected tool nodes
type NodePosition ¶
NodePosition represents the visual position of a node
type StepDefinition ¶
type StepDefinition struct {
Id string `json:"id"` // Node ID for graph-aware executors
Name string `json:"name"`
Type string `json:"type"`
Config map[string]interface{} `json:"config"`
}
StepDefinition defines a single step in an agent pipeline
type StepExecutor ¶
type StepExecutor interface {
// Execute runs the step with the given config and returns the result
Execute(ctx context.Context, step *StepDefinition, resolver TemplateResolver) (*StepResult, error)
// Type returns the step type this executor handles
Type() string
}
StepExecutor defines the interface for executing a single step type Skills must implement this interface for each node type they provide.
type StepResult ¶
type StepResult struct {
Output map[string]interface{}
NextStep string // For branching steps (if, switch) - empty means continue to next
Error error
}
StepResult represents the output of a step execution
type StreamCallback ¶
type StreamCallback func(update *StreamUpdate)
StreamCallback is called by streaming executors to emit partial outputs
type StreamUpdate ¶
type StreamUpdate struct {
Partial interface{} // The incremental chunk of data
Progress float64 // 0.0-1.0 progress indicator
}
StreamUpdate represents a partial output from a streaming executor
type StreamingExecutor ¶
type StreamingExecutor interface {
StepExecutor
// ExecuteStreaming runs the step and calls the callback for each partial output
// The final result is still returned via StepResult
ExecuteStreaming(ctx context.Context, step *StepDefinition, resolver TemplateResolver, onStream StreamCallback) (*StepResult, error)
// SupportsStreaming returns true if this executor can stream with the given config
SupportsStreaming(config map[string]interface{}) bool
}
StreamingExecutor is an optional interface for executors that support streaming partial outputs
type TemplateResolver ¶
type TemplateResolver interface {
ResolveString(template string) string
ResolveMap(input map[string]interface{}) map[string]interface{}
EvaluateCondition(condition string) bool
SetVariable(name string, value interface{})
GetStepOutput(stepName string) interface{}
SetStepOutput(stepName string, output interface{})
}
TemplateResolver interface for resolving {{}} templates Provided by Axiom at runtime to skills. See github.com/axiom-studio/skills.sdk/resolver for a standard implementation.