Documentation
¶
Index ¶
- type Agent
- type AgentInput
- type AgentOutput
- type AgentPolicy
- type AgentRunner
- type ApprovalPolicy
- type CheckpointState
- type Decision
- type Event
- type EventSink
- type EventSinkFunc
- type EventType
- type HumanGate
- type HumanInLoopPolicy
- type LLMProfileRef
- type MemoryRef
- type Orchestration
- type OrchestrationMode
- type PlanningPolicy
- type PromptFragment
- type RetryPolicy
- type RuntimePolicy
- type Scenario
- type SideEffectLevel
- type Skill
- type SkillToolPolicy
- type Tool
- type ToolCall
- type ToolExecutor
- type ToolResolver
- type ToolResolverFunc
- type ToolResult
- type Trigger
- type Workflow
- type WorkflowEdge
- type WorkflowNode
- type WorkflowNodeKind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Role string `json:"role,omitempty"`
Instructions string `json:"instructions,omitempty"`
LLM string `json:"llm,omitempty"`
Memory string `json:"memory,omitempty"`
Tools []string `json:"tools,omitempty"`
Skills []string `json:"skills,omitempty"`
SubAgents []string `json:"sub_agents,omitempty"`
Policy AgentPolicy `json:"policy"`
Metadata map[string]string `json:"metadata,omitempty"`
}
type AgentInput ¶
type AgentInput struct {
RunID string `json:"run_id"`
Prompt string `json:"prompt,omitempty"`
Context json.RawMessage `json:"context,omitempty"`
}
type AgentOutput ¶
type AgentOutput struct {
RunID string `json:"run_id"`
Text string `json:"text,omitempty"`
Raw json.RawMessage `json:"raw,omitempty"`
Events []Event `json:"events,omitempty"`
}
type AgentPolicy ¶
type AgentRunner ¶
type AgentRunner interface {
Run(ctx context.Context, input AgentInput) (AgentOutput, error)
}
type ApprovalPolicy ¶
type ApprovalPolicy string
const ( ApprovalNever ApprovalPolicy = "never" ApprovalRisky ApprovalPolicy = "risky" ApprovalAlways ApprovalPolicy = "always" // ApprovalPause pauses the run at a human gate instead of denying the tool call. ApprovalPause ApprovalPolicy = "pause" )
type CheckpointState ¶
type CheckpointState struct {
RunID string `json:"run_id"`
Version int64 `json:"version"`
NodeID string `json:"node_id"`
Payload json.RawMessage `json:"payload,omitempty"`
}
type Decision ¶
type Decision string
Decision is the human decision made at a human-in-the-loop checkpoint.
func (*Decision) UnmarshalText ¶
type Event ¶
type Event struct {
Type EventType `json:"type"`
RunID string `json:"run_id"`
ScenarioName string `json:"scenario_name,omitempty"`
Timestamp time.Time `json:"timestamp"`
TraceID string `json:"trace_id,omitempty"`
SpanID string `json:"span_id,omitempty"`
Payload json.RawMessage `json:"payload,omitempty"`
}
type EventSinkFunc ¶
type EventType ¶
type EventType string
const ( EventRunStarted EventType = "RunStarted" EventRunCompleted EventType = "RunCompleted" EventRunFailed EventType = "RunFailed" EventRunPaused EventType = "RunPaused" EventRunResumed EventType = "RunResumed" EventStepStarted EventType = "StepStarted" EventStepCompleted EventType = "StepCompleted" EventStepFailed EventType = "StepFailed" EventToolCalled EventType = "ToolCalled" EventToolReturned EventType = "ToolReturned" EventToolDenied EventType = "ToolDenied" EventLLMCalled EventType = "LLMCalled" EventLLMReturned EventType = "LLMReturned" EventLLMTokenUsage EventType = "LLMTokenUsage" EventHumanGateOpened EventType = "HumanGateOpened" EventHumanGateDecided EventType = "HumanGateDecided" EventHumanGateExpired EventType = "HumanGateExpired" EventMemoryRead EventType = "MemoryRead" EventMemoryWrite EventType = "MemoryWrite" EventContextPrepared EventType = "ContextPrepared" )
type HumanInLoopPolicy ¶
type LLMProfileRef ¶
type LLMProfileRef struct {
Provider string `json:"provider"`
Model string `json:"model"`
Endpoint string `json:"endpoint,omitempty"`
APIKeyEnv string `json:"api_key_env,omitempty"`
ContextWindowTokens int `json:"context_window_tokens,omitempty"`
MaxOutputTokens int `json:"max_output_tokens,omitempty"`
Temperature *float32 `json:"temperature,omitempty"`
TopP *float32 `json:"top_p,omitempty"`
Timeout time.Duration `json:"timeout,omitempty"`
Thinking llm.ThinkingConfig `json:"thinking,omitempty"`
ReasoningEffort string `json:"reasoning_effort,omitempty"`
Context contextwindow.Policy `json:"context,omitempty"`
ExtraBody map[string]any `json:"extra_body,omitempty"`
Capabilities []string `json:"capabilities,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
}
type Orchestration ¶
type Orchestration struct {
Mode OrchestrationMode `json:"mode"`
Workflow *Workflow `json:"workflow,omitempty"`
MaxParallel int `json:"max_parallel,omitempty"`
HumanInLoop HumanInLoopPolicy `json:"human_in_loop"`
Planning PlanningPolicy `json:"planning,omitempty"`
}
type OrchestrationMode ¶
type OrchestrationMode string
const ( OrchestrationAutonomous OrchestrationMode = "autonomous" OrchestrationFixedWorkflow OrchestrationMode = "fixed_workflow" OrchestrationHybrid OrchestrationMode = "hybrid" )
type PlanningPolicy ¶
type PromptFragment ¶
type RetryPolicy ¶
type RetryPolicy struct {
MaxAttempts int `json:"max_attempts,omitempty"`
}
type RuntimePolicy ¶
type RuntimePolicy struct {
Timeout time.Duration `json:"timeout,omitempty"`
MaxSteps int `json:"max_steps,omitempty"`
MaxRetries int `json:"max_retries,omitempty"`
MaxParallel int `json:"max_parallel,omitempty"`
StepOutputThreshold int64 `json:"step_output_threshold,omitempty"`
Secrets map[string]string `json:"secrets,omitempty"`
}
type Scenario ¶
type Scenario struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
LLMs map[string]LLMProfileRef `json:"llms,omitempty"`
Memories map[string]MemoryRef `json:"memories,omitempty"`
Tools map[string]Tool `json:"tools,omitempty"`
Skills map[string]Skill `json:"skills,omitempty"`
Agents map[string]Agent `json:"agents,omitempty"`
Triggers []Trigger `json:"triggers,omitempty"`
Orchestration Orchestration `json:"orchestration"`
Runtime RuntimePolicy `json:"runtime"`
}
type SideEffectLevel ¶
type SideEffectLevel string
const ( SideEffectNone SideEffectLevel = "none" SideEffectRead SideEffectLevel = "read" SideEffectWrite SideEffectLevel = "write" SideEffectExternal SideEffectLevel = "external" SideEffectDangerous SideEffectLevel = "dangerous" )
type Skill ¶
type Skill struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Version string `json:"version,omitempty"`
CompatibleAgents []string `json:"compatible_agents,omitempty"`
PromptFragments []PromptFragment `json:"prompt_fragments,omitempty"`
AgentPolicy AgentPolicy `json:"agent_policy,omitempty"`
ToolPolicies []SkillToolPolicy `json:"tool_policies,omitempty"`
Workflow *Workflow `json:"workflow,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
}
type SkillToolPolicy ¶
type SkillToolPolicy struct {
Tool string `json:"tool"`
Approval ApprovalPolicy `json:"approval,omitempty"`
SideEffect SideEffectLevel `json:"side_effect,omitempty"`
RateCap int `json:"rate_cap,omitempty"`
}
type Tool ¶
type Tool struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Type string `json:"type"`
InputSchema json.RawMessage `json:"input_schema,omitempty"`
OutputSchema json.RawMessage `json:"output_schema,omitempty"`
SideEffect SideEffectLevel `json:"side_effect,omitempty"`
Approval ApprovalPolicy `json:"approval,omitempty"`
LLM string `json:"llm,omitempty"`
RateCap int `json:"rate_cap,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
}
type ToolExecutor ¶
type ToolExecutor interface {
Execute(ctx context.Context, call ToolCall) (ToolResult, error)
}
type ToolResolver ¶
type ToolResolver interface {
ResolveTool(ctx context.Context, tool Tool) (ToolExecutor, error)
}
ToolResolver resolves a declared tool manifest to an executor at call time. Resolvers are useful for heavy or tenant-scoped tools whose clients should not be initialized during scenario loading.
type ToolResolverFunc ¶
type ToolResolverFunc func(ctx context.Context, tool Tool) (ToolExecutor, error)
func (ToolResolverFunc) ResolveTool ¶
func (fn ToolResolverFunc) ResolveTool(ctx context.Context, tool Tool) (ToolExecutor, error)
type ToolResult ¶
type ToolResult struct {
Tool string `json:"tool"`
Output json.RawMessage `json:"output,omitempty"`
Error string `json:"error,omitempty"`
}
type Trigger ¶ added in v0.1.2
type Trigger struct {
Event string `json:"event"`
Agent string `json:"agent,omitempty"`
PromptPath string `json:"prompt_path,omitempty"`
ContextPath string `json:"context_path,omitempty"`
RunIDPath string `json:"run_id_path,omitempty"`
DefaultPrompt string `json:"default_prompt,omitempty"`
}
Trigger maps an external event type to a run request template.
type Workflow ¶
type Workflow struct {
Nodes []WorkflowNode `json:"nodes,omitempty"`
Edges []WorkflowEdge `json:"edges,omitempty"`
}
type WorkflowEdge ¶
type WorkflowNode ¶
type WorkflowNode struct {
ID string `json:"id"`
Kind WorkflowNodeKind `json:"kind"`
Ref string `json:"ref,omitempty"`
Input json.RawMessage `json:"input,omitempty"`
DependsOn []string `json:"depends_on,omitempty"`
Condition string `json:"condition,omitempty"`
Retry RetryPolicy `json:"retry"`
}
type WorkflowNodeKind ¶
type WorkflowNodeKind string
const ( NodeAgent WorkflowNodeKind = "agent" NodeTool WorkflowNodeKind = "tool" NodeSkill WorkflowNodeKind = "skill" NodeHumanGate WorkflowNodeKind = "human_gate" NodeTransform WorkflowNodeKind = "transform" NodeParallelGroup WorkflowNodeKind = "parallel_group" NodeLoop WorkflowNodeKind = "loop" )
Click to show internal directories.
Click to hide internal directories.