invoke_agent スパンを出力します。
weave.startSubagent() (または turn.startAgent()、あるいは
llm.startAgent()) で作成し、end() で終了します。
例
階層
-
SpanBase↳SubAgent
目次
プロパティ
メソッド
プロパティ
モデル
Readonly モデル: string
定義場所
名
Readonly name: string
定義場所
メソッド
addEvent
name, attributes?, startTime?): this
スパン に名前付きイベントを追加します。コンテキストの圧縮、tool ループの検出、
または guardrail の発動など、スパン 以外の時点を記録する際に便利です。end() の後に呼び出すと警告を出し、
何も行いません。OTel Span.addEvent と同様の動作です。
パラメーター
| 名 | タイプ |
|---|---|
name | string |
attributes? | Attributes |
startTime? | TimeInput |
戻り値
this
例
継承元
定義場所
end
opts?): void
SubAgent の スパン を終了します。冪等です。失敗としてマークするには、error を渡します。
終了時刻を過去にさかのぼって設定するには、endTime を渡します。
パラメーター
| 名 | タイプ |
|---|---|
opts? | SpanEndOptions |
戻り値
void
定義場所
setAttributes
attributes): this
スパンに複数の属性をまとめて設定します。end() の後に呼び出すと、警告を出して何も実行しません。OTel の Span.setAttributes (および Python SDK の
set_attributes) に準拠しています。
パラメーター
| 名 | タイプ |
|---|---|
attributes | Attributes |
戻り値
this
例
継承元
定義場所
create
opts): SubAgent
パラメーター
| 名 | タイプ |
|---|---|
opts | SubAgentInit & ChildSpanContext |
戻り値
SubAgent