Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions agent/workflowagents/sequentialagent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ import (
"google.golang.org/adk/v2/tool/functiontool"
)

// New creates a SequentialAgent.
//
// SequentialAgent executes its sub-agents once, in the order they are listed.
// seqAgent is the agent returned by New; it augments the base agent with the
// live-mode entry point.
type seqAgent struct {
agent.Agent
*agentinternal.State
Expand All @@ -41,11 +40,14 @@ func (s *seqAgent) RunLive(ctx agent.InvocationContext) (agent.LiveSession, iter
return s.impl.RunLive(ctx)
}

// New creates a SequentialAgent.
//
// SequentialAgent executes its sub-agents once, in the order they are listed.
// Use the SequentialAgent when you want the execution to occur in a fixed,
// strict order.
func New(cfg Config) (agent.Agent, error) {
if cfg.AgentConfig.Run != nil {
return nil, fmt.Errorf("LoopAgent doesn't allow custom Run implementations")
return nil, fmt.Errorf("SequentialAgent doesn't allow custom Run implementations")
}

sequentialAgentImpl := &sequentialAgent{}
Expand Down
Loading