weave / SubAgent A nested agent invocation — used when the current agent hands work to another named agent (e.g. a planner calling a researcher). Emits anDocumentation Index
Fetch the complete documentation index at: https://wb-21fd5541-update-reference-docs-34.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
invoke_agent span tagged with the sub-agent’s name and (optionally)
its model.
Created by weave.startSubagent() (or turn.startAgent(), or
llm.startAgent()) and terminated with end().
Example
Table of contents
Properties
Methods
Properties
model
•Readonly model: string
Defined in
genai/subagent.ts:41name
•Readonly name: string
Defined in
genai/subagent.ts:40Methods
end
▸ end(opts?): void
Close the SubAgent span. Idempotent. Pass error to mark it as failed.
Parameters
| Name | Type |
|---|---|
opts? | Object |
opts.error? | Error |
Returns
void
Defined in
genai/subagent.ts:65create
▸ create(opts): SubAgent
Parameters
| Name | Type |
|---|---|
opts | SubAgentInit & ChildSpanContext |
Returns
SubAgent