Skip to main content

spawn_sub_agent

Method
This is a method of the AgentTeam class in the agents module.
Spawn a sub-agent for non-blocking execution (sync version). Implements the SpawnAnnounceProtocol for efficient parallel sub-agent workflows. Integrates with existing handoff infrastructure to avoid code duplication. Uses threading.Thread for background execution. Note: For async contexts, use aspawn_sub_agent() which uses asyncio primitives. This method is safe to call from sync contexts only.

Signature

Parameters

Agent
required
No description available.
Any
required
No description available.
Optional
No description available.
Optional
No description available.

Returns

SpawnedSubAgent
The result of the operation.

Uses

  • uuid.uuid4
  • EventBus
  • subscribe
  • SpawnedSubAgent
  • time.time
  • publish
  • agent.start
  • announce_completion
  • threading.Thread
  • spawn_thread.start

Source

View on GitHub

praisonaiagents/agents/agents.py at line 3164

Agents Concept

Single Agent Guide

Multi-Agent Guide

Agent Configuration

Auto Agents