org.llm4s.agent.Handoff
See theHandoff companion object
Represents a handoff to another agent.
Handoffs provide a simpler alternative to DAG-based orchestration for common delegation patterns. The LLM decides when to invoke a handoff by calling a generated handoff tool.
Example:
val generalAgent = new Agent(client)
val specialistAgent = new Agent(client)
generalAgent.run(
"Explain quantum entanglement",
tools,
handoffs = Seq(
Handoff(
targetAgent = specialistAgent,
transferReason = Some("Requires physics expertise"),
preserveContext = true
)
)
)
Value parameters
- preserveContext
-
Whether to transfer conversation history (default: true)
- targetAgent
-
The agent to hand off to
- transferReason
-
Optional reason for the handoff (shown to LLM in tool description)
- transferSystemMessage
-
Whether to transfer system message (default: false)
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
Members list
In this article