> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wandb.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# WeaveClient

> TypeScript SDK リファレンス

定義元: [src/weaveClient.ts:445](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L445)

<div id="properties">
  ## プロパティ
</div>

<div id="projectid">
  ### projectId
</div>

> **projectId**: `string`

定義元: [src/weaveClient.ts:456](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L456)

***

<div id="settings">
  ### settings
</div>

> **settings**: [`Settings`](../type-aliases/settings)

定義元: [src/weaveClient.ts:457](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L457)

***

<div id="traceserverapi">
  ### traceServerApi
</div>

> **traceServerApi**: `Api`\<`any`>

定義元: [src/weaveClient.ts:455](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L455)

<div id="methods">
  ## メソッド
</div>

<div id="addscore">
  ### addScore()
</div>

> **addScore**(`predictCallId`, `scorerCallId`, `runnableRefUri`, `scorerOutput`): `Promise`\<`string`>

Scorer の結果 (Scorer の出力など) を Call に追加します。
命令型の評価で、Scorer の結果を予測 Call に関連付けるために使用します。

定義元: [src/weaveClient.ts:1727](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L1727)

#### パラメーター

<div id="predictcallid">
  ##### predictCallId
</div>

`string`

フィードバックを紐付ける予測CallのID

<div id="scorercallid">
  ##### scorerCallId
</div>

`string`

feedback を生成した Scorer Call の ID

<div id="runnablerefuri">
  ##### runnableRefUri
</div>

`string`

Scorer (Op または Object ref) のURI

<div id="scoreroutput">
  ##### scorerOutput
</div>

`any`

Scorer の出力

#### 戻り値

`Promise`\<`string`>

***

<div id="createcall">
  ### createCall()
</div>

> **createCall**(`internalCall`, `opRef`, `params`, `parameterNames`, `thisArg`, `currentCall`, `parentCall`, `startTime`, `displayName?`, `attributes?`): `Promise`\<`void`>

定義元: [src/weaveClient.ts:1570](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L1570)

#### パラメーター

<div id="internalcall">
  ##### internalCall
</div>

`InternalCall`

<div id="opref">
  ##### opRef
</div>

`any`

<div id="params">
  ##### params
</div>

`any`\[]

<div id="parameternames">
  ##### パラメーター名
</div>

`ParameterNamesOption`

<div id="thisarg">
  ##### thisArg
</div>

`any`

<div id="currentcall">
  ##### currentCall
</div>

`CallStackEntry`

<div id="parentcall">
  ##### parentCall
</div>

`CallStackEntry` | `undefined`

<div id="starttime">
  ##### startTime
</div>

`Date`

##### 表示名?

`string`

<div id="attributes">
  ##### 属性?
</div>

`Record`\<`string`, `any`>

#### 戻り値

`Promise`\<`void`>

***

<div id="finishcall">
  ### finishCall()
</div>

> **finishCall**(`call`, `result`, `currentCall`, `parentCall`, `summarize`, `endTime`, `startCallPromise`): `Promise`\<`void`>

定義元: [src/weaveClient.ts:1630](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L1630)

#### パラメーター

<div id="call">
  ##### call
</div>

`InternalCall`

<div id="result">
  ##### result
</div>

`any`

<div id="currentcall">
  ##### currentCall
</div>

`CallStackEntry`

<div id="parentcall">
  ##### parentCall
</div>

`CallStackEntry` | `undefined`

<div id="summarize">
  ##### summarize
</div>

((`result`) => `Record`\<`string`, `any`>) | `undefined`

<div id="endtime">
  ##### 終了時刻
</div>

`Date`

<div id="startcallpromise">
  ##### startCallPromise
</div>

`Promise`\<`void`>

#### 戻り値

`Promise`\<`void`>

***

<div id="finishcallwithexception">
  ### finishCallWithException()
</div>

> **finishCallWithException**(`call`, `error`, `currentCall`, `parentCall`, `endTime`, `startCallPromise`): `Promise`\<`void`>

定義元: [src/weaveClient.ts:1672](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L1672)

#### パラメーター

<div id="call">
  ##### call
</div>

`InternalCall`

<div id="error">
  ##### error
</div>

`any`

<div id="currentcall">
  ##### currentCall
</div>

`CallStackEntry`

<div id="parentcall">
  ##### parentCall
</div>

`CallStackEntry` | `undefined`

<div id="endtime">
  ##### 終了時刻
</div>

`Date`

<div id="startcallpromise">
  ##### startCallPromise
</div>

`Promise`\<`void`>

#### 戻り値

`Promise`\<`void`>

***

<div id="get">
  ### get()
</div>

> **get**(`ref`): `Promise`\<`any`>

定義元: [src/weaveClient.ts:1025](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L1025)

#### パラメーター

<div id="ref">
  ##### ref
</div>

[`ObjectRef`](../classes/objectref)

#### 戻り値

`Promise`\<`any`>

***

<div id="getagentcustomattributes">
  ### getAgentCustomAttributes()
</div>

> **getAgentCustomAttributes**(`options`): `Promise`\<[`Response`](../type-aliases/response)\<`GetAgentCustomAttributesResult`>>

project 内のエージェント スパンで検出された、型付きカスタム属性キーを取得します。各結果行は 1 つの `(source, key, value_type)` トリプルと、そのトリプルを持つスパン数で構成されます。スパンのクエリ、グループ化、統計 API では、この形式でカスタム属性を参照します。

`query` (構造化スパンフィルター) 、`startedAfter` / `startedBefore` (ISO-8601) 、または両方を指定して、対象のスパンをフィルターします。検出されたキーをページングするには、`limit` / `offset` を使用します。

定義元: [src/weaveClient.ts:772](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L772)

#### パラメーター

##### オプション

`GetAgentCustomAttributesOptions`

#### 戻り値

`Promise`\<[`Response`](../type-aliases/response)\<`GetAgentCustomAttributesResult`>>

<div id="example">
  #### 例
</div>

```ts twoslash theme={null}
// @noErrors
const client = await weave.init('entity/project');
const resp = await client.getAgentCustomAttributes({
  query: {
    $expr: {
      $eq: [{$getField: 'agent_name'}, {$literal: 'my-agent'}],
    },
  },
  startedAfter: '2026-06-15T00:00:00Z',
  limit: 200,
});

for (const attr of resp.data.attributes ?? []) {
  console.log(`${attr.source}.${attr.key} (${attr.value_type}): ${attr.span_count}`);
}
```

***

<div id="getagents">
  ### getAgents()
</div>

> **getAgents**(`options?`): `Promise`\<[`Response`](../type-aliases/response)\<[`GetAgentsResult`](../type-aliases/getagentsresult)>>

集計された統計情報を含むエージェントの一覧を取得します。

定義元: [src/weaveClient.ts:488](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L488)

#### パラメーター

##### オプション?

[`GetAgentsOptions`](./getagentsoptions) = `{}`

#### 戻り値

`Promise`\<[`Response`](../type-aliases/response)\<[`GetAgentsResult`](../type-aliases/getagentsresult)>>

<div id="example">
  #### 例
</div>

```ts twoslash theme={null}
// @noErrors
const client = await weave.init('entity/project');
const resp = await client.getAgents({limit: 20});

for (const agent of resp.data.agents) {
  console.log(agent.agent_name, agent.total_input_tokens);
}

console.log(`total count: ${resp.data.total_count}`)
```

***

<div id="getagentspans">
  ### getAgentSpans()
</div>

> **getAgentSpans**(`options`): `Promise`\<[`Response`](../type-aliases/response)\<[`GetAgentSpansResult`](../type-aliases/getagentspansresult)>>

エージェント スパンをクエリします。必要に応じて、エージェント名や Mongo スタイルのクエリ式でフィルターできます。

定義元: [src/weaveClient.ts:566](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L566)

#### パラメーター

##### オプション

[`GetAgentSpansOptions`](./getagentspansoptions)

#### 戻り値

`Promise`\<[`Response`](../type-aliases/response)\<[`GetAgentSpansResult`](../type-aliases/getagentspansresult)>>

<div id="example">
  #### 例
</div>

```ts twoslash theme={null}
// @noErrors
const client = await weave.init('entity/project');
const resp = await client.getAgentSpans({agentName: 'my-agent', limit: 20});

for (const span of resp.data.spans) {
  console.log(span.span_id, span.span_name, span.input_tokens);
}
```

```ts twoslash theme={null}
// @noErrors
const client = await weave.init('entity/project');

const resp = await client.getAgentSpans({
  agentName: 'my-agent',
  query: {
    $expr: {$gt: [{$getField: 'input_tokens'}, {$literal: 1000}]},
  },
});

for (const span of resp.data.spans) {
  console.log(span.span_id, span.span_name, span.input_tokens);
}
```

***

<div id="getagentspanstats">
  ### getAgentSpanStats()
</div>

> **getAgentSpanStats**(`options`): `Promise`\<[`Response`](../type-aliases/response)\<`GetAgentSpanStatsResult`>>

project 内のエージェント スパンに対する集約結果を、時系列または時間バケットの可視化に適した行と列のメタデータとして返します。

`start` (必須) と`end`で時間範囲を指定します。`metrics`の各エントリでは、抽出するフィールドと集約方法 (`sum`、`avg`、`count`、パーセンタイルなど) を指定します。行を時間単位でバケット化するには`granularity` (秒) を指定し、エージェント／provider／モデルなどごとに結果を分けるには`groupBy`を指定します。`query`は、集約前に対象となるスパンをフィルターします。

定義元: [src/weaveClient.ts:621](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L621)

#### パラメーター

##### オプション

`GetAgentSpanStatsOptions`

#### 戻り値

`Promise`\<[`Response`](../type-aliases/response)\<`GetAgentSpanStatsResult`>>

<div id="example">
  #### 例
</div>

```ts twoslash theme={null}
// @noErrors
const client = await weave.init('entity/project');
const resp = await client.getAgentSpanStats({
  start: '2026-06-10T00:00:00Z',
  end: '2026-06-23T00:00:00Z',
  granularity: 86400, // 1 日あたり 1 行
  metrics: [
    {
      alias: 'total_input_tokens',
      value_type: 'number',
      aggregations: ['sum'],
      value: {source: 'field', key: 'input_tokens'},
    },
  ],
  groupBy: [{key: 'agent_name'}],
});

for (const row of resp.data.rows ?? []) {
  console.log(row.started_at_bucket, row.agent_name, row.total_input_tokens);
}
```

***

<div id="getagentturn">
  ### getAgentTurn()
</div>

> **getAgentTurn**(`options`): `Promise`\<[`Response`](../type-aliases/response)\<`AgentTraceChatRes`>>

指定した traceId の単一ターンに関するデータ (メッセージを含む) を取得します。

定義元: [src/weaveClient.ts:655](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L655)

#### パラメーター

##### オプション

[`GetAgentTurnOptions`](./getagentturnoptions)

#### 戻り値

`Promise`\<[`Response`](../type-aliases/response)\<`AgentTraceChatRes`>>

<div id="example">
  #### 例
</div>

```ts twoslash theme={null}
// @noErrors
const client = await weave.init('entity/project');
const resp = await client.getAgentTurn({
  traceId: '01997b8a-2c89-7c4d-9d0e-2f7e5b9a1b2c',
  includeFeedback: true,
});

console.log(resp.data.root_span_name, resp.data.total_duration_ms);

for (const message of resp.data.messages ?? []) {
  if (message.user_message) console.log('user:', message.user_message);
  if (message.assistant_message) console.log('assistant:', message.assistant_message);
}
```

***

<div id="getagentturns">
  ### getAgentTurns()
</div>

> **getAgentTurns**(`options`): `Promise`\<[`Response`](../type-aliases/response)\<[`GetAgentTurnsResult`](../type-aliases/getagentturnsresult)>>

会話 ID を指定して、複数のターンのデータ (メッセージを含む) を取得します。

定義元: [src/weaveClient.ts:688](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L688)

#### パラメーター

##### オプション

[`GetAgentTurnsOptions`](./getagentturnsoptions)

#### 戻り値

`Promise`\<[`Response`](../type-aliases/response)\<[`GetAgentTurnsResult`](../type-aliases/getagentturnsresult)>>

<div id="example">
  #### 例
</div>

```ts twoslash theme={null}
// @noErrors
const client = await weave.init('entity/project');
const resp = await client.getAgentTurns({
  conversationId: 'trace_c50312356de3487fa90e381c9399b5b4',
  limit: 20,
  includeFeedback: true,
});

for (const turn of resp.data.turns ?? []) {
  console.log(turn.trace_id, turn.root_span_name);
  for (const message of turn.messages ?? []) {
    if (message.user_message) console.log('user:', message.user_message);
    if (message.assistant_message) console.log('assistant:', message.assistant_message);
  }
}

console.log(`total turns: ${resp.data.total_turns}, has more: ${resp.data.has_more}`);
```

***

<div id="getagentversions">
  ### getAgentVersions()
</div>

> **getAgentVersions**(`options`): `Promise`\<[`Response`](../type-aliases/response)\<[`GetAgentVersionsResult`](../type-aliases/getagentversionsresult)>>

指定したエージェントのバージョンを一覧表示します。

定義元: [src/weaveClient.ts:522](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L522)

#### パラメーター

##### オプション

[`GetAgentVersionsOptions`](./getagentversionsoptions)

#### 戻り値

`Promise`\<[`Response`](../type-aliases/response)\<[`GetAgentVersionsResult`](../type-aliases/getagentversionsresult)>>

<div id="example">
  #### 例
</div>

```ts twoslash theme={null}
// @noErrors
const client = await weave.init('entity/project');
const resp = await client.getAgentVersions({agentName: 'my-agent', limit: 20});

for (const version of resp.data.versions) {
  console.log(version.agent_version, version.total_input_tokens);
}

console.log(`total count: ${resp.data.total_count}`)
```

***

<div id="getcall">
  ### getCall()
</div>

> **getCall**(`callId`, `includeCosts?`): `Promise`\<`Call`>

定義元: [src/weaveClient.ts:902](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L902)

#### パラメーター

<div id="callid">
  ##### callId
</div>

`string`

##### includeCosts?

`boolean` = `false`

#### 戻り値

`Promise`\<`Call`>

***

<div id="getcalls">
  ### getCalls()
</div>

<div id="call-signature">
  #### Call Signature
</div>

> **getCalls**(`options?`): `Promise`\<`Call`\[]>

定義元: [src/weaveClient.ts:935](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L935)

<div id="parameters">
  ##### パラメーター
</div>

###### オプション

[`GetCallsOptions`](./getcallsoptions)

<div id="returns">
  ##### 戻り値
</div>

`Promise`\<`Call`\[]>

<div id="call-signature">
  #### Call Signature
</div>

> **getCalls**(`options?`, `includeCosts?`, `limit?`): `Promise`\<`Call`\[]>

定義元: [src/weaveClient.ts:936](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L936)

<div id="parameters">
  ##### パラメーター
</div>

<div id="options">
  ###### オプション?
</div>

[`CallsFilter`](./callsfilter)

<div id="includecosts">
  ###### includeCosts?
</div>

`boolean`

<div id="limit">
  ###### limit?
</div>

`数値`

<div id="returns">
  ##### 戻り値
</div>

`Promise`\<`Call`\[]>

***

<div id="getcallsiterator">
  ### getCallsIterator()
</div>

<div id="call-signature">
  #### Call Signature
</div>

> **getCallsIterator**(`options?`, `includeCosts?`, `limit?`): `AsyncIterableIterator`\<[`CallSchema`](./callschema)>

定義元: [src/weaveClient.ts:957](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L957)

<div id="parameters">
  ##### パラメーター
</div>

<div id="options">
  ###### オプション?
</div>

[`CallsFilter`](./callsfilter)

<div id="includecosts">
  ###### includeCosts?
</div>

`boolean`

<div id="limit">
  ###### limit?
</div>

`数値`

<div id="returns">
  ##### 戻り値
</div>

`AsyncIterableIterator`\<[`CallSchema`](./callschema)>

<div id="call-signature">
  #### Call Signature
</div>

> **getCallsIterator**(`options?`): `AsyncIterableIterator`\<[`CallSchema`](./callschema)>

定義元: [src/weaveClient.ts:962](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L962)

<div id="parameters">
  ##### パラメーター
</div>

<div id="options">
  ###### オプション?
</div>

[`GetCallsOptions`](./getcallsoptions)

<div id="returns">
  ##### 戻り値
</div>

`AsyncIterableIterator`\<[`CallSchema`](./callschema)>

***

<div id="getcallstack">
  ### getCallStack()
</div>

> **getCallStack**(): `CallStack`

定義元: [src/weaveClient.ts:1482](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L1482)

#### 戻り値

`CallStack`

***

<div id="getcurrentattributes">
  ### getCurrentAttributes()
</div>

> **getCurrentAttributes**(): `Record`\<`string`, `any`>

定義元: [src/weaveClient.ts:1486](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L1486)

#### 戻り値

`Record`\<`string`, `any`>

***

<div id="linkprompttoregistry">
  ### linkPromptToRegistry()
</div>

> **linkPromptToRegistry**(`prompt`, `options`): `Promise`\<`LinkAssetToRegistryRes`>

公開済みの prompt バージョンを Registry ポートフォリオにリンクします。

定義元: [src/weaveClient.ts:1181](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L1181)

#### パラメーター

<div id="prompt">
  ##### プロンプト
</div>

`RegistryLinkable`

##### オプション

`LinkPromptToRegistryOptions`

#### 戻り値

`Promise`\<`LinkAssetToRegistryRes`>

***

<div id="publish">
  ### publish()
</div>

> **publish**(`obj`, `objId?`): `Promise`\<[`ObjectRef`](../classes/objectref)>

定義元: [src/weaveClient.ts:890](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L890)

#### パラメーター

<div id="obj">
  ##### obj
</div>

`any`

<div id="objid">
  ##### objId?
</div>

`string`

#### 戻り値

`Promise`\<[`ObjectRef`](../classes/objectref)>

***

<div id="pushnewcall">
  ### pushNewCall()
</div>

> **pushNewCall**(): `object`

定義元: [src/weaveClient.ts:1490](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L1490)

#### 戻り値

`object`

<div id="currentcall">
  ##### currentCall
</div>

> **currentCall**: `CallStackEntry`

<div id="newstack">
  ##### newStack
</div>

> **newStack**: `CallStack`

<div id="parentcall">
  ##### parentCall
</div>

> `optional` **親Call**: `CallStackEntry`

***

<div id="runwithattributes">
  ### runWithAttributes()
</div>

> **runWithAttributes**\<`T`>(`attributes`, `fn`): `T`

定義元: [src/weaveClient.ts:1498](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L1498)

<div id="type-parameters">
  #### タイプパラメーター
</div>

<div id="t">
  ##### T
</div>

`T`

#### パラメーター

##### 属性

`Record`\<`string`, `any`>

<div id="fn">
  ##### fn
</div>

() => `T`

#### 戻り値

`T`

***

<div id="runwithcallstack">
  ### runWithCallStack()
</div>

> **runWithCallStack**\<`T`>(`callStack`, `fn`): `T`

定義元: [src/weaveClient.ts:1494](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L1494)

<div id="type-parameters">
  #### タイプパラメーター
</div>

<div id="t">
  ##### T
</div>

`T`

#### パラメーター

<div id="callstack">
  ##### callStack
</div>

`CallStack`

<div id="fn">
  ##### fn
</div>

() => `T`

#### 戻り値

`T`

***

<div id="savecallend">
  ### saveCallEnd()
</div>

> **saveCallEnd**(`callEnd`): `void`

定義元: [src/weaveClient.ts:1477](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L1477)

#### パラメーター

<div id="callend">
  ##### callEnd
</div>

`EndedCallSchemaForInsert`

#### 戻り値

`void`

***

<div id="savecallstart">
  ### saveCallStart()
</div>

> **saveCallStart**(`callStart`): `void`

定義元: [src/weaveClient.ts:1472](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L1472)

#### パラメーター

<div id="callstart">
  ##### callStart
</div>

`StartedCallSchemaForInsert`

#### 戻り値

`void`

***

<div id="saveop">
  ### saveOp()
</div>

> **saveOp**(`op`, `objId?`): `Promise`\<`OpRef`>

定義元: [src/weaveClient.ts:1537](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L1537)

#### パラメーター

<div id="op">
  ##### op
</div>

[`Op`](../type-aliases/op)\<(...`args`) => `any`>

<div id="objid">
  ##### objId?
</div>

`string`

#### 戻り値

`Promise`\<`OpRef`>

***

<div id="searchagents">
  ### searchAgents()
</div>

> **searchAgents**(`options`): `Promise`\<[`Response`](../type-aliases/response)\<`SearchAgentsResult`>>

project 内のエージェントメッセージを全文検索します。一致したメッセージのプレビューを含む結果を、会話ごとにグループ化して返します。

`query` は全文検索の検索語です。空の文字列を渡すと、テキスト検索を行わずに構造化フィルター (`agentName`、`conversationId`、`traceId`) に一致するすべてのメッセージを取得します。`limit` / `offset` を使用して結果をページネーションします。

定義元: [src/weaveClient.ts:730](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L730)

#### パラメーター

##### オプション

`SearchAgentsOptions`

#### 戻り値

`Promise`\<[`Response`](../type-aliases/response)\<`SearchAgentsResult`>>

<div id="example">
  #### 例
</div>

```ts twoslash theme={null}
// @noErrors
const client = await weave.init('entity/project');
const resp = await client.searchAgents({
  query: 'Liverpool',
  agentName: 'Assistant',
  limit: 20,
});

for (const conversation of resp.data.results ?? []) {
  console.log(`${conversation.conversation_id} (${conversation.agent_name})`);
  for (const match of conversation.matched_messages) {
    console.log(`  [${match.role}] ${match.content_preview}`);
  }
}

console.log(`total conversations: ${resp.data.total_conversations}`);
```

***

<div id="serializeaudio">
  ### serializeAudio()
</div>

> **serializeAudio**(`data`, `audioType?`): `Promise`\<`SerializedFileBlob`>

生のオーディオバイトを Weave コンテンツストアにアップロードし、Call の出力に埋め込み可能な
`CustomWeaveType` プレースホルダーを返します。

`finishCall` の自動シリアル化パイプラインを使用せずに、`saveCallEnd` 経由などで Call の出力を手動で構築する場合に使用します。

定義元: [src/weaveClient.ts:1424](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L1424)

#### パラメーター

<div id="data">
  ##### data
</div>

`Buffer`

生のオーディオバイト (ブラウザとの互換性を最大限確保するには WAV)

<div id="audiotype">
  ##### audioType?
</div>

`"wav"` = `DEFAULT_AUDIO_TYPE`

file 形式 — 現在サポートされているのは「wav」のみです

#### 戻り値

`Promise`\<`SerializedFileBlob`>

***

<div id="updatecall">
  ### updateCall()
</div>

> **updateCall**(`callId`, `displayName`): `Promise`\<`void`>

定義元: [src/weaveClient.ts:1710](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L1710)

#### パラメーター

<div id="callid">
  ##### callId
</div>

`string`

<div id="displayname">
  ##### displayName
</div>

`string`

#### 戻り値

`Promise`\<`void`>

***

<div id="waitforbatchprocessing">
  ### waitForBatchProcessing()
</div>

> **waitForBatchProcessing**(): `Promise`\<`void`>

定義元: [src/weaveClient.ts:801](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/weaveClient.ts#L801)

#### 戻り値

`Promise`\<`void`>
