Skip to main content

clone_for_channel

Method
This is a method of the Agent class in the agent module.
Return a fully independent copy of this agent for a gateway channel. This method safely clones an agent for use in multi-channel scenarios by avoiding deepcopy issues with tools/handoffs and creating fresh instances of mutable objects like interrupt_controller.

Signature

Returns

'Agent'
A new Agent instance with copied configuration but fresh locks, interrupt controller, and shallow-copied tools.

Uses

  • warnings.warn
  • ExecutionConfig
  • MemoryConfig

Source

View on GitHub

praisonaiagents/agent/agent.py at line 2562