planning

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package planning provides task decomposition and strategy planning capabilities for agents.

Index

Constants

View Source
const (
	AgentPlanning          = "planning_agent"
	AgentTaskDecomposition = "task_decomposition_agent"
	AgentStrategy          = "strategy_agent"
)

Agent names

View Source
const (
	DescPlanning          = "Creates and executes plans to achieve goals"
	DescTaskDecomposition = "Decomposes complex tasks into manageable subtasks"
	DescStrategyAgent     = "Selects and applies planning strategies to optimize plans"
)

Agent descriptions

View Source
const (
	StrategyDecomposition    = "decomposition"
	StrategyBackwardChaining = "backward_chaining"
	StrategyHierarchical     = "hierarchical"
	StrategyForwardChaining  = "forward_chaining"
	StrategyGoalOriented     = "goal_oriented"
)

Strategy names

View Source
const (
	StatusPending    = "pending"
	StatusInProgress = "in_progress"
	StatusCompleted  = "completed"
	StatusFailed     = "failed"
	StatusCanceled   = "canceled"
)

Plan statuses

View Source
const (
	DefaultMaxSteps       = 20
	DefaultMaxDuration    = 3600 // seconds
	DefaultMaxParallelism = 5
	DefaultRetryAttempts  = 3
)

Plan constraints defaults

View Source
const (
	ErrPlanningFailed      = "planning failed"
	ErrPlanExecutionFailed = "plan execution failed"
	ErrInvalidPlan         = "invalid plan"
	ErrStepFailed          = "step execution failed"
	ErrDependencyNotMet    = "dependency not met"
	ErrTimeoutExceeded     = "timeout exceeded"
)

Planning error messages

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentExecutor

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

AgentExecutor executes plans using agents

func NewAgentExecutor

func NewAgentExecutor(logger loggercore.Logger, opts ...ExecutorOption) *AgentExecutor

NewAgentExecutor creates a new agent-based plan executor

func (*AgentExecutor) Cancel

func (e *AgentExecutor) Cancel(planID string) error

Cancel cancels plan execution

func (*AgentExecutor) Execute

func (e *AgentExecutor) Execute(ctx context.Context, plan *Plan) (*PlanResult, error)

Execute executes a plan

func (*AgentExecutor) ExecuteStep

func (e *AgentExecutor) ExecuteStep(ctx context.Context, step *Step) (*StepResult, error)

ExecuteStep executes a single step (implements interface)

func (*AgentExecutor) GetStatus

func (e *AgentExecutor) GetStatus(planID string) (*PlanStatus, error)

GetStatus gets the current status of a plan

func (*AgentExecutor) Pause

func (e *AgentExecutor) Pause(planID string) error

Pause pauses plan execution

func (*AgentExecutor) Resume

func (e *AgentExecutor) Resume(planID string) error

Resume resumes plan execution

type AgentRegistry

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

AgentRegistry manages available agents

func NewAgentRegistry

func NewAgentRegistry() *AgentRegistry

NewAgentRegistry creates a new agent registry

func (*AgentRegistry) GetAgent

func (r *AgentRegistry) GetAgent(name string) core.Agent

GetAgent gets an agent by name

func (*AgentRegistry) RegisterAgent

func (r *AgentRegistry) RegisterAgent(name string, agent core.Agent)

RegisterAgent registers an agent

type BackwardChainingStrategy

type BackwardChainingStrategy struct{}

BackwardChainingStrategy works backward from goal to current state

func (*BackwardChainingStrategy) Apply

func (s *BackwardChainingStrategy) Apply(ctx context.Context, plan *Plan, constraints PlanConstraints) (*Plan, error)

func (*BackwardChainingStrategy) Name

func (s *BackwardChainingStrategy) Name() string

type DecompositionStrategy

type DecompositionStrategy struct{}

DecompositionStrategy breaks down complex goals into simpler steps

func (*DecompositionStrategy) Apply

func (s *DecompositionStrategy) Apply(ctx context.Context, plan *Plan, constraints PlanConstraints) (*Plan, error)

func (*DecompositionStrategy) Name

func (s *DecompositionStrategy) Name() string

type DefaultOptimizer

type DefaultOptimizer struct{}

DefaultOptimizer provides basic plan optimization

func (*DefaultOptimizer) Optimize

func (o *DefaultOptimizer) Optimize(ctx context.Context, plan *Plan) (*Plan, error)

type DependencyValidator

type DependencyValidator struct{}

DependencyValidator validates step dependencies

func (*DependencyValidator) Validate

func (v *DependencyValidator) Validate(ctx context.Context, plan *Plan) (bool, []string, error)

type ExecutionState

type ExecutionState struct {
	Plan        *Plan
	Status      PlanStatus
	StartTime   time.Time
	EndTime     time.Time
	StepResults map[string]*StepResult
	CurrentStep string
	PauseChan   chan struct{}
	CancelChan  chan struct{}
	// contains filtered or unexported fields
}

ExecutionState tracks the state of a plan execution

type ExecutorOption

type ExecutorOption func(*AgentExecutor)

ExecutorOption configures the executor

func WithMaxConcurrency

func WithMaxConcurrency(max int) ExecutorOption

WithMaxConcurrency sets the maximum concurrent step executions

func WithRetryPolicy

func WithRetryPolicy(policy RetryPolicy) ExecutorOption

WithRetryPolicy sets the retry policy

type ExpectedOutcome

type ExpectedOutcome struct {
	Description string                 `json:"description"`
	Criteria    []string               `json:"criteria"`
	Metrics     map[string]interface{} `json:"metrics,omitempty"`
}

ExpectedOutcome defines what we expect from a step

type HierarchicalStrategy

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

HierarchicalStrategy creates multi-level plans

func (*HierarchicalStrategy) Apply

func (s *HierarchicalStrategy) Apply(ctx context.Context, plan *Plan, constraints PlanConstraints) (*Plan, error)

func (*HierarchicalStrategy) Name

func (s *HierarchicalStrategy) Name() string

type MockAgent

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

MockAgent is a complete mock agent for testing

func NewMockAgent

func NewMockAgent(name string) *MockAgent

func (*MockAgent) Batch

func (m *MockAgent) Batch(ctx context.Context, inputs []*core.AgentInput) ([]*core.AgentOutput, error)

func (*MockAgent) Capabilities

func (m *MockAgent) Capabilities() []string

func (*MockAgent) Description

func (m *MockAgent) Description() string

func (*MockAgent) Invoke

func (m *MockAgent) Invoke(ctx context.Context, input *core.AgentInput) (*core.AgentOutput, error)

func (*MockAgent) Name

func (m *MockAgent) Name() string

func (*MockAgent) Pipe

func (*MockAgent) SetInvokeFn

func (m *MockAgent) SetInvokeFn(fn func(ctx context.Context, input *core.AgentInput) (*core.AgentOutput, error))

SetInvokeFn sets a custom invoke function for testing

func (*MockAgent) Stream

func (m *MockAgent) Stream(ctx context.Context, input *core.AgentInput) (<-chan core.StreamChunk[*core.AgentOutput], error)

func (*MockAgent) WithCallbacks

func (m *MockAgent) WithCallbacks(callbacks ...core.Callback) core.Runnable[*core.AgentInput, *core.AgentOutput]

func (*MockAgent) WithConfig

type MockLLMClient

type MockLLMClient struct {
	CompleteFn    func(ctx context.Context, req *llm.CompletionRequest) (*llm.CompletionResponse, error)
	ChatFn        func(ctx context.Context, messages []llm.Message) (*llm.CompletionResponse, error)
	ProviderFn    func() constants.Provider
	IsAvailableFn func() bool
}

MockLLMClient is a complete mock LLM client for testing

func (*MockLLMClient) Chat

func (m *MockLLMClient) Chat(ctx context.Context, messages []llm.Message) (*llm.CompletionResponse, error)

func (*MockLLMClient) Complete

func (*MockLLMClient) IsAvailable

func (m *MockLLMClient) IsAvailable() bool

func (*MockLLMClient) Provider

func (m *MockLLMClient) Provider() constants.Provider

type MockLogger

type MockLogger struct{}

MockLogger is a complete mock logger for testing

func (*MockLogger) Debug

func (m *MockLogger) Debug(args ...interface{})

func (*MockLogger) Debugf

func (m *MockLogger) Debugf(template string, args ...interface{})

func (*MockLogger) Debugw

func (m *MockLogger) Debugw(msg string, keysAndValues ...interface{})

func (*MockLogger) Error

func (m *MockLogger) Error(args ...interface{})

func (*MockLogger) Errorf

func (m *MockLogger) Errorf(template string, args ...interface{})

func (*MockLogger) Errorw

func (m *MockLogger) Errorw(msg string, keysAndValues ...interface{})

func (*MockLogger) Fatal

func (m *MockLogger) Fatal(args ...interface{})

func (*MockLogger) Fatalf

func (m *MockLogger) Fatalf(template string, args ...interface{})

func (*MockLogger) Fatalw

func (m *MockLogger) Fatalw(msg string, keysAndValues ...interface{})

func (*MockLogger) Flush

func (m *MockLogger) Flush() error

func (*MockLogger) Info

func (m *MockLogger) Info(args ...interface{})

func (*MockLogger) Infof

func (m *MockLogger) Infof(template string, args ...interface{})

func (*MockLogger) Infow

func (m *MockLogger) Infow(msg string, keysAndValues ...interface{})

func (*MockLogger) SetLevel

func (m *MockLogger) SetLevel(level loggercore.Level)

func (*MockLogger) Warn

func (m *MockLogger) Warn(args ...interface{})

func (*MockLogger) Warnf

func (m *MockLogger) Warnf(template string, args ...interface{})

func (*MockLogger) Warnw

func (m *MockLogger) Warnw(msg string, keysAndValues ...interface{})

func (*MockLogger) With

func (m *MockLogger) With(keyValues ...interface{}) loggercore.Logger

func (*MockLogger) WithCallerSkip

func (m *MockLogger) WithCallerSkip(skip int) loggercore.Logger

func (*MockLogger) WithCtx

func (m *MockLogger) WithCtx(ctx context.Context, keyValues ...interface{}) loggercore.Logger

type MockMemoryManager

type MockMemoryManager struct {
	AddConversationFn        func(ctx context.Context, conv *interfaces.Conversation) error
	GetConversationHistoryFn func(ctx context.Context, sessionID string, limit int) ([]*interfaces.Conversation, error)
	ClearConversationFn      func(ctx context.Context, sessionID string) error
	AddCaseFn                func(ctx context.Context, caseMemory *interfaces.Case) error
	SearchSimilarCasesFn     func(ctx context.Context, query string, limit int) ([]*interfaces.Case, error)
	GetCaseFn                func(ctx context.Context, caseID string) (*interfaces.Case, error)
	UpdateCaseFn             func(ctx context.Context, caseMemory *interfaces.Case) error
	DeleteCaseFn             func(ctx context.Context, caseID string) error
	StoreFn                  func(ctx context.Context, key string, value interface{}) error
	RetrieveFn               func(ctx context.Context, key string) (interface{}, error)
	DeleteFn                 func(ctx context.Context, key string) error
}

MockMemoryManager is a complete mock memory manager for testing

func (*MockMemoryManager) AddCase

func (m *MockMemoryManager) AddCase(ctx context.Context, caseMemory *interfaces.Case) error

func (*MockMemoryManager) AddConversation

func (m *MockMemoryManager) AddConversation(ctx context.Context, conv *interfaces.Conversation) error

func (*MockMemoryManager) Clear

func (m *MockMemoryManager) Clear(ctx context.Context) error

Clear removes all memory (implements MemoryManager interface)

func (*MockMemoryManager) ClearConversation

func (m *MockMemoryManager) ClearConversation(ctx context.Context, sessionID string) error

func (*MockMemoryManager) Delete

func (m *MockMemoryManager) Delete(ctx context.Context, key string) error

Delete removes stored data by key

func (*MockMemoryManager) DeleteCase

func (m *MockMemoryManager) DeleteCase(ctx context.Context, caseID string) error

func (*MockMemoryManager) GetCase

func (m *MockMemoryManager) GetCase(ctx context.Context, caseID string) (*interfaces.Case, error)

func (*MockMemoryManager) GetConversationHistory

func (m *MockMemoryManager) GetConversationHistory(ctx context.Context, sessionID string, limit int) ([]*interfaces.Conversation, error)

func (*MockMemoryManager) Retrieve

func (m *MockMemoryManager) Retrieve(ctx context.Context, key string) (interface{}, error)

Retrieve fetches stored data by key

func (*MockMemoryManager) SearchSimilarCases

func (m *MockMemoryManager) SearchSimilarCases(ctx context.Context, query string, limit int) ([]*interfaces.Case, error)

func (*MockMemoryManager) Store

func (m *MockMemoryManager) Store(ctx context.Context, key string, value interface{}) error

Store persists key-value data

func (*MockMemoryManager) UpdateCase

func (m *MockMemoryManager) UpdateCase(ctx context.Context, caseMemory *interfaces.Case) error

type NoOpStrategy

type NoOpStrategy struct{}

NoOpStrategy does nothing (used as fallback)

func (*NoOpStrategy) Apply

func (s *NoOpStrategy) Apply(ctx context.Context, plan *Plan, constraints PlanConstraints) (*Plan, error)

func (*NoOpStrategy) Name

func (s *NoOpStrategy) Name() string

type OptimizationAgent

type OptimizationAgent struct {
	*core.BaseAgent
	// contains filtered or unexported fields
}

OptimizationAgent optimizes plans for efficiency

func NewOptimizationAgent

func NewOptimizationAgent(optimizer PlanOptimizer) *OptimizationAgent

NewOptimizationAgent creates a new optimization agent

func (*OptimizationAgent) Execute

func (a *OptimizationAgent) Execute(ctx context.Context, input *core.AgentInput) (*core.AgentOutput, error)

Execute optimizes a plan

type Phase

type Phase struct {
	Name        string
	Description string
}

type Plan

type Plan struct {
	ID           string                 `json:"id"`
	Goal         string                 `json:"goal"`
	Strategy     string                 `json:"strategy"`
	Steps        []*Step                `json:"steps"`
	Dependencies map[string][]string    `json:"dependencies"` // step ID -> dependent step IDs
	Context      map[string]interface{} `json:"context"`
	CreatedAt    time.Time              `json:"created_at"`
	UpdatedAt    time.Time              `json:"updated_at"`
	Status       PlanStatus             `json:"status"`
	Metrics      *PlanMetrics           `json:"metrics,omitempty"`
}

Plan represents a structured plan for achieving a goal

type PlanConstraints

type PlanConstraints struct {
	MaxSteps       int                    `json:"max_steps,omitempty"`
	MaxDuration    time.Duration          `json:"max_duration,omitempty"`
	RequiredSteps  []string               `json:"required_steps,omitempty"`
	ForbiddenSteps []string               `json:"forbidden_steps,omitempty"`
	Resources      map[string]interface{} `json:"resources,omitempty"`
	Priority       int                    `json:"priority,omitempty"`
}

PlanConstraints defines constraints for plan creation

type PlanExecutor

type PlanExecutor interface {
	// Execute executes a plan
	Execute(ctx context.Context, plan *Plan) (*PlanResult, error)

	// ExecuteStep executes a single step
	ExecuteStep(ctx context.Context, step *Step) (*StepResult, error)

	// Pause pauses plan execution
	Pause(planID string) error

	// Resume resumes plan execution
	Resume(planID string) error

	// Cancel cancels plan execution
	Cancel(planID string) error

	// GetStatus gets the current status of a plan
	GetStatus(planID string) (*PlanStatus, error)
}

PlanExecutor executes plans using agents

type PlanMetrics

type PlanMetrics struct {
	TotalSteps     int           `json:"total_steps"`
	CompletedSteps int           `json:"completed_steps"`
	FailedSteps    int           `json:"failed_steps"`
	SkippedSteps   int           `json:"skipped_steps"`
	TotalDuration  time.Duration `json:"total_duration"`
	StartTime      time.Time     `json:"start_time"`
	EndTime        time.Time     `json:"end_time,omitempty"`
	SuccessRate    float64       `json:"success_rate"`
}

PlanMetrics tracks plan execution metrics

type PlanOptimizer

type PlanOptimizer interface {
	// Optimize optimizes a plan
	Optimize(ctx context.Context, plan *Plan) (*Plan, error)
}

PlanOptimizer optimizes plans for efficiency

type PlanResult

type PlanResult struct {
	PlanID         string                 `json:"plan_id"`
	Success        bool                   `json:"success"`
	CompletedSteps int                    `json:"completed_steps"`
	FailedSteps    int                    `json:"failed_steps"`
	SkippedSteps   int                    `json:"skipped_steps"`
	TotalDuration  time.Duration          `json:"total_duration"`
	StepResults    map[string]*StepResult `json:"step_results"`
	Error          error                  `json:"error,omitempty"`
	Metadata       map[string]interface{} `json:"metadata,omitempty"`
}

PlanResult contains the result of executing a plan

type PlanStatus

type PlanStatus string

PlanStatus represents the status of a plan

const (
	PlanStatusDraft     PlanStatus = "draft"
	PlanStatusReady     PlanStatus = "ready"
	PlanStatusExecuting PlanStatus = "executing"
	PlanStatusCompleted PlanStatus = "completed"
	PlanStatusFailed    PlanStatus = "failed"
	PlanStatusCancelled PlanStatus = "cancelled"
)

type PlanStrategy

type PlanStrategy interface {
	// Apply applies the strategy to a plan
	Apply(ctx context.Context, plan *Plan, constraints PlanConstraints) (*Plan, error)

	// Name returns the strategy name
	Name() string
}

PlanStrategy defines a strategy for plan creation and refinement

type PlanValidator

type PlanValidator interface {
	// Validate checks if a plan is valid
	Validate(ctx context.Context, plan *Plan) (bool, []string, error)
}

PlanValidator validates plans for feasibility

type Planner

type Planner interface {
	// CreatePlan creates a plan for achieving a goal
	CreatePlan(ctx context.Context, goal string, constraints PlanConstraints) (*Plan, error)

	// RefinePlan refines an existing plan based on feedback
	RefinePlan(ctx context.Context, plan *Plan, feedback string) (*Plan, error)

	// DecomposePlan breaks down a plan into more detailed steps
	DecomposePlan(ctx context.Context, plan *Plan, step *Step) ([]*Step, error)

	// OptimizePlan optimizes a plan for efficiency
	OptimizePlan(ctx context.Context, plan *Plan) (*Plan, error)

	// ValidatePlan validates that a plan is feasible
	ValidatePlan(ctx context.Context, plan *Plan) (bool, []string, error)
}

Planner interface for creating and managing plans

type PlannerOption

type PlannerOption func(*SmartPlanner)

PlannerOption configures the planner

func WithMaxDepth

func WithMaxDepth(depth int) PlannerOption

WithMaxDepth sets the maximum planning depth

func WithOptimizer

func WithOptimizer(optimizer PlanOptimizer) PlannerOption

WithOptimizer sets the plan optimizer

func WithTimeout

func WithTimeout(timeout time.Duration) PlannerOption

WithTimeout sets the planning timeout

type PlanningAgent

type PlanningAgent struct {
	*core.BaseAgent
	// contains filtered or unexported fields
}

PlanningAgent is an agent that creates and executes plans

func NewPlanningAgent

func NewPlanningAgent(planner Planner, executor PlanExecutor) *PlanningAgent

NewPlanningAgent creates a new planning agent

func (*PlanningAgent) Execute

func (a *PlanningAgent) Execute(ctx context.Context, input *core.AgentInput) (*core.AgentOutput, error)

Execute implements the Agent interface

type ResourceValidator

type ResourceValidator struct{}

ResourceValidator validates resource constraints

func (*ResourceValidator) Validate

func (v *ResourceValidator) Validate(ctx context.Context, plan *Plan) (bool, []string, error)

type RetryPolicy

type RetryPolicy struct {
	MaxRetries    int           `json:"max_retries"`
	RetryDelay    time.Duration `json:"retry_delay"`
	BackoffFactor float64       `json:"backoff_factor"`
}

RetryPolicy defines retry behavior for failed steps

type SmartPlanner

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

SmartPlanner uses LLM and memory to create intelligent plans

func NewSmartPlanner

func NewSmartPlanner(llmClient llm.Client, mem interfaces.MemoryManager, opts ...PlannerOption) *SmartPlanner

NewSmartPlanner creates a new smart planner

func (*SmartPlanner) AddValidator

func (p *SmartPlanner) AddValidator(validator PlanValidator)

AddValidator adds a plan validator

func (*SmartPlanner) CreatePlan

func (p *SmartPlanner) CreatePlan(ctx context.Context, goal string, constraints PlanConstraints) (*Plan, error)

CreatePlan creates a plan for achieving a goal

func (*SmartPlanner) DecomposePlan

func (p *SmartPlanner) DecomposePlan(ctx context.Context, plan *Plan, step *Step) ([]*Step, error)

DecomposePlan breaks down a plan step into more detailed sub-steps

func (*SmartPlanner) OptimizePlan

func (p *SmartPlanner) OptimizePlan(ctx context.Context, plan *Plan) (*Plan, error)

OptimizePlan optimizes a plan for efficiency

func (*SmartPlanner) RefinePlan

func (p *SmartPlanner) RefinePlan(ctx context.Context, plan *Plan, feedback string) (*Plan, error)

RefinePlan refines an existing plan based on feedback

func (*SmartPlanner) RegisterStrategy

func (p *SmartPlanner) RegisterStrategy(name string, strategy PlanStrategy)

RegisterStrategy registers a planning strategy

func (*SmartPlanner) ValidatePlan

func (p *SmartPlanner) ValidatePlan(ctx context.Context, plan *Plan) (bool, []string, error)

ValidatePlan validates that a plan is feasible

type Step

type Step struct {
	ID                string                 `json:"id"`
	Name              string                 `json:"name"`
	Description       string                 `json:"description"`
	Type              StepType               `json:"type"`
	Agent             string                 `json:"agent,omitempty"` // Agent to execute this step
	Parameters        map[string]interface{} `json:"parameters,omitempty"`
	Expected          *ExpectedOutcome       `json:"expected,omitempty"`
	Priority          int                    `json:"priority"`
	EstimatedDuration time.Duration          `json:"estimated_duration,omitempty"`
	Status            StepStatus             `json:"status"`
	Result            *StepResult            `json:"result,omitempty"`
}

Step represents a single step in a plan

type StepResult

type StepResult struct {
	Success   bool                   `json:"success"`
	Output    interface{}            `json:"output"`
	Error     string                 `json:"error,omitempty"`
	Duration  time.Duration          `json:"duration"`
	Timestamp time.Time              `json:"timestamp"`
	Metadata  map[string]interface{} `json:"metadata,omitempty"`
}

StepResult contains the execution result of a step

type StepStatus

type StepStatus string

StepStatus represents the status of a step

const (
	StepStatusPending   StepStatus = "pending"
	StepStatusReady     StepStatus = "ready"
	StepStatusExecuting StepStatus = "executing"
	StepStatusCompleted StepStatus = "completed"
	StepStatusFailed    StepStatus = "failed"
	StepStatusSkipped   StepStatus = "skipped"
)

type StepType

type StepType string

StepType defines the type of a planning step

const (
	StepTypeAnalysis     StepType = "analysis"
	StepTypeDecision     StepType = "decision"
	StepTypeAction       StepType = "action"
	StepTypeValidation   StepType = "validation"
	StepTypeOptimization StepType = "optimization"
)

type StrategyAgent

type StrategyAgent struct {
	*core.BaseAgent
	// contains filtered or unexported fields
}

StrategyAgent selects and applies planning strategies

func NewStrategyAgent

func NewStrategyAgent() *StrategyAgent

NewStrategyAgent creates a new strategy agent

func (*StrategyAgent) Execute

func (a *StrategyAgent) Execute(ctx context.Context, input *core.AgentInput) (*core.AgentOutput, error)

Execute selects and applies a strategy to a plan

func (*StrategyAgent) RegisterStrategy

func (a *StrategyAgent) RegisterStrategy(name string, strategy PlanStrategy)

RegisterStrategy registers a new strategy

type TaskDecompositionAgent

type TaskDecompositionAgent struct {
	*core.BaseAgent
	// contains filtered or unexported fields
}

TaskDecompositionAgent decomposes complex tasks into subtasks

func NewTaskDecompositionAgent

func NewTaskDecompositionAgent(planner Planner) *TaskDecompositionAgent

NewTaskDecompositionAgent creates a new task decomposition agent

func (*TaskDecompositionAgent) Execute

Execute decomposes a task into subtasks

type TimeValidator

type TimeValidator struct{}

TimeValidator validates timing constraints

func (*TimeValidator) Validate

func (v *TimeValidator) Validate(ctx context.Context, plan *Plan) (bool, []string, error)

type ValidationAgent

type ValidationAgent struct {
	*core.BaseAgent
	// contains filtered or unexported fields
}

ValidationAgent validates plans for feasibility

func NewValidationAgent

func NewValidationAgent() *ValidationAgent

NewValidationAgent creates a new validation agent

func (*ValidationAgent) AddValidator

func (a *ValidationAgent) AddValidator(validator PlanValidator)

AddValidator adds a validator

func (*ValidationAgent) Execute

func (a *ValidationAgent) Execute(ctx context.Context, input *core.AgentInput) (*core.AgentOutput, error)

Execute validates a plan

Jump to

Keyboard shortcuts

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