> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-dbrian-docs-serverless-training-quickstart.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Classe : WeaveClient

> Référence du SDK TypeScript

[weave](../) / WeaveClient

<div id="table-of-contents">
  ## Table des matières
</div>

<div id="constructors">
  ### Constructeurs
</div>

* [constructeur](./weaveclient#constructor)

<div id="properties">
  ### Propriétés
</div>

* [projectId](./weaveclient#projectid)
* [settings](./weaveclient#settings)
* [traceServerApi](./weaveclient#traceserverapi)

<div id="methods">
  ### Méthodes
</div>

* [addScore](./weaveclient#addscore)
* [createCall](./weaveclient#createcall)
* [finishCall](./weaveclient#finishcall)
* [finishCallWithException](./weaveclient#finishcallwithexception)
* [get](./weaveclient#get)
* [getAgentCustomAttributes](./weaveclient#getagentcustomattributes)
* [getAgentSpanStats](./weaveclient#getagentspanstats)
* [getAgentSpans](./weaveclient#getagentspans)
* [getAgentTurn](./weaveclient#getagentturn)
* [getAgentTurns](./weaveclient#getagentturns)
* [getAgentVersions](./weaveclient#getagentversions)
* [getAgents](./weaveclient#getagents)
* [getCall](./weaveclient#getcall)
* [getCallStack](./weaveclient#getcallstack)
* [getCalls](./weaveclient#getcalls)
* [getCallsIterator](./weaveclient#getcallsiterator)
* [getCurrentAttributes](./weaveclient#getcurrentattributes)
* [linkPromptToRegistry](./weaveclient#linkprompttoregistry)
* [publish](./weaveclient#publish)
* [pushNewCall](./weaveclient#pushnewcall)
* [runWithAttributes](./weaveclient#runwithattributes)
* [runWithCallStack](./weaveclient#runwithcallstack)
* [saveCallEnd](./weaveclient#savecallend)
* [saveCallStart](./weaveclient#savecallstart)
* [saveOp](./weaveclient#saveop)
* [searchAgents](./weaveclient#searchagents)
* [serializeAudio](./weaveclient#serializeaudio)
* [updateCall](./weaveclient#updatecall)
* [waitForBatchProcessing](./weaveclient#waitforbatchprocessing)

## Constructeurs

<div id="constructor">
  ### constructeur
</div>

• **new WeaveClient**(`«destructured»`): [`WeaveClient`](./weaveclient)

<div id="parameters">
  #### Paramètres
</div>

| Nom                | Type                                   |
| :----------------- | :------------------------------------- |
| `«destructured»`   | `objet`                                |
| › `projectId`      | `string`                               |
| › `settings?`      | `Partial`\<[`Settings`](../#settings)> |
| › `traceServerApi` | `Api`\<`any`>                          |

<div id="returns">
  #### Renvoie
</div>

[`WeaveClient`](./weaveclient)

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:459](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L459)

## Propriétés

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

• **projectId**: `string`

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:456](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L456)

***

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

• **settings**: [`Settings`](../#settings)

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:457](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L457)

***

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

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

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:455](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L455)

## Méthodes

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

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

Ajoute un résultat de scorer (par ex. la sortie du scorer) à un appel.
Utilisé dans l’évaluation impérative pour associer les résultats du scorer aux appels de prédiction.

<div id="parameters">
  #### Paramètres
</div>

| Nom              | Type     | Description                                       |
| :--------------- | :------- | :------------------------------------------------ |
| `predictCallId`  | `string` | ID de l'appel `predict` auquel associer le retour |
| `scorerCallId`   | `string` | ID de l'appel du scorer ayant généré le retour    |
| `runnableRefUri` | `string` | URI du scorer (op ou réf. d'objet)                |
| `scorerOutput`   | `any`    | Résultat du scorer                                |

<div id="returns">
  #### Renvoie
</div>

`Promise`\<`string`>

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:1727](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L1727)

***

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

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

<div id="parameters">
  #### Paramètres
</div>

| Nom              | Type                       |                  |
| :--------------- | :------------------------- | ---------------- |
| `internalCall`   | `InternalCall`             |                  |
| `opRef`          | `any`                      |                  |
| `params`         | `any`\[]                   |                  |
| `parameterNames` | `ParameterNamesOption`     |                  |
| `thisArg`        | `any`                      |                  |
| `currentCall`    | `CallStackEntry`           |                  |
| `parentCall`     | `undefined`                | `CallStackEntry` |
| `startTime`      | `Date`                     |                  |
| `displayName?`   | `string`                   |                  |
| `attributes?`    | `Record`\<`string`, `any`> |                  |

<div id="returns">
  #### Renvoie
</div>

`Promise`\<`void`>

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:1570](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L1570)

***

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

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

<div id="parameters">
  #### Paramètres
</div>

| Nom                | Type               |                                                 |
| :----------------- | :----------------- | ----------------------------------------------- |
| `call`             | `InternalCall`     |                                                 |
| `result`           | `any`              |                                                 |
| `currentCall`      | `CallStackEntry`   |                                                 |
| `parentCall`       | `undefined`        | `CallStackEntry`                                |
| `summarize`        | `undefined`        | (`result`: `any`) => `Record`\<`string`, `any`> |
| `endTime`          | `Date`             |                                                 |
| `startCallPromise` | `Promise`\<`void`> |                                                 |

<div id="returns">
  #### Renvoie
</div>

`Promise`\<`void`>

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:1630](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L1630)

***

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

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

<div id="parameters">
  #### Paramètres
</div>

| Nom                | Type               |                  |
| :----------------- | :----------------- | ---------------- |
| `call`             | `InternalCall`     |                  |
| `error`            | `any`              |                  |
| `currentCall`      | `CallStackEntry`   |                  |
| `parentCall`       | `undefined`        | `CallStackEntry` |
| `endTime`          | `Date`             |                  |
| `startCallPromise` | `Promise`\<`void`> |                  |

<div id="returns">
  #### Renvoie
</div>

`Promise`\<`void`>

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:1672](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L1672)

***

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

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

<div id="parameters">
  #### Paramètres
</div>

| Nom   | Type                       |
| :---- | :------------------------- |
| `ref` | [`ObjectRef`](./objectref) |

<div id="returns">
  #### Renvoie
</div>

`Promise`\<`any`>

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:1025](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L1025)

***

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

▸ **getAgentCustomAttributes**(`options`): `Promise`\<[`Réponse`](../#response)\<`GetAgentCustomAttributesResult`>>

Découvrez les clés d’attributs personnalisés typés observées sur les spans d’agent dans le
projet. Chaque ligne de résultat correspond à un triplet `(source, key, value_type)`, ainsi qu’au
nombre de spans qui le portent ; c’est ce qu’utilisent les API de
requête/groupe/stats des spans pour référencer les attributs personnalisés.

Filtrez les spans pris en compte en transmettant `query` (un filtre de span
structuré), `startedAfter` / `startedBefore` (ISO-8601), ou les deux. Utilisez
`limit` / `offset` pour parcourir les clés découvertes par pages.

<div id="parameters">
  #### Paramètres
</div>

| Nom       | Type                              |
| :-------- | :-------------------------------- |
| `options` | `GetAgentCustomAttributesOptions` |

<div id="returns">
  #### Renvoie
</div>

`Promise`\<[`Réponse`](../#response)\<`GetAgentCustomAttributesResult`>>

`Exemple`

```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="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:772](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L772)

***

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

▸ **getAgentSpanStats**(`options`): `Promise`\<[`Réponse`](../#response)\<`GetAgentSpanStatsResult`>>

Agrégations sur les spans d’agent dans le projet, renvoyées sous forme de lignes + métadonnées de
colonne adaptées aux visualisations de séries chronologiques / en buckets.

`start` (requis) et `end` définissent la fenêtre temporelle. Chaque entrée de
`metrics` déclare un champ à extraire et la façon de l’agréger (`sum`,
`avg`, `count`, percentiles, etc.). Transmettez `granularity` (secondes) pour
regrouper les lignes par bucket temporel, ou `groupBy` pour ventiler les résultats par agent /
provider / model / etc. `query` filtre les spans correspondants avant
l’agrégation.

<div id="parameters">
  #### Paramètres
</div>

| Nom       | Type                       |
| :-------- | :------------------------- |
| `options` | `GetAgentSpanStatsOptions` |

<div id="returns">
  #### Renvoie
</div>

`Promise`\<[`Réponse`](../#response)\<`GetAgentSpanStatsResult`>>

`Exemple`

```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, // une ligne par jour
  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="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:621](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L621)

***

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

▸ **getAgentSpans**(`options`): `Promise`\<[`Réponse`](../#response)\<[`GetAgentSpansResult`](../#getagentspansresult)>>

Interroge les spans des agents, avec un filtrage facultatif par nom d’agent et/ou via une
expression de requête de type Mongo.

<div id="parameters">
  #### Paramètres
</div>

| Nom       | Type                                                         |
| :-------- | :----------------------------------------------------------- |
| `options` | [`GetAgentSpansOptions`](../interfaces/getagentspansoptions) |

<div id="returns">
  #### Renvoie
</div>

`Promise`\<[`Réponse`](../#response)\<[`GetAgentSpansResult`](../#getagentspansresult)>>

`Exemple`

```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);
}
```

`Exemple`

```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="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:566](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L566)

***

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

▸ **getAgentTurn**(`options`): `Promise`\<[`Réponse`](../#response)\<`AgentTraceChatRes`>>

Obtenez les données (y compris les messages) d’un seul tour de conversation (par traceId).

<div id="parameters">
  #### Paramètres
</div>

| Nom       | Type                                                       |
| :-------- | :--------------------------------------------------------- |
| `options` | [`GetAgentTurnOptions`](../interfaces/getagentturnoptions) |

<div id="returns">
  #### Renvoie
</div>

`Promise`\<[`Réponse`](../#response)\<`AgentTraceChatRes`>>

`Exemple`

```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="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:655](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L655)

***

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

▸ **getAgentTurns**(`options`): `Promise`\<[`Réponse`](../#response)\<[`GetAgentTurnsResult`](../#getagentturnsresult)>>

Obtenir les données (y compris les messages) de plusieurs tours de conversation (par conversationId).

<div id="parameters">
  #### Paramètres
</div>

| Nom       | Type                                                         |
| :-------- | :----------------------------------------------------------- |
| `options` | [`GetAgentTurnsOptions`](../interfaces/getagentturnsoptions) |

<div id="returns">
  #### Renvoie
</div>

`Promise`\<[`Réponse`](../#response)\<[`GetAgentTurnsResult`](../#getagentturnsresult)>>

`Exemple`

```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="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:688](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L688)

***

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

▸ **getAgentVersions**(`options`): `Promise`\<[`Réponse`](../#response)\<[`GetAgentVersionsResult`](../#getagentversionsresult)>>

Répertorie les versions d’un agent donné.

<div id="parameters">
  #### Paramètres
</div>

| Nom       | Type                                                               |
| :-------- | :----------------------------------------------------------------- |
| `options` | [`GetAgentVersionsOptions`](../interfaces/getagentversionsoptions) |

<div id="returns">
  #### Renvoie
</div>

`Promise`\<[`Réponse`](../#response)\<[`GetAgentVersionsResult`](../#getagentversionsresult)>>

`Exemple`

```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="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:522](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L522)

***

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

▸ **getAgents**(`options?`): `Promise`\<[`Réponse`](../#response)\<[`GetAgentsResult`](../#getagentsresult)>>

Renvoie la liste des agents avec des statistiques agrégées.

<div id="parameters">
  #### Paramètres
</div>

| Nom       | Type                                                 |
| :-------- | :--------------------------------------------------- |
| `options` | [`GetAgentsOptions`](../interfaces/getagentsoptions) |

<div id="returns">
  #### Renvoie
</div>

`Promise`\<[`Réponse`](../#response)\<[`GetAgentsResult`](../#getagentsresult)>>

`Exemple`

```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="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:488](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L488)

***

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

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

<div id="parameters">
  #### Paramètres
</div>

| Nom            | Type      | Valeur par défaut |
| :------------- | :-------- | :---------------- |
| `callId`       | `string`  | `undefined`       |
| `includeCosts` | `boolean` | `false`           |

<div id="returns">
  #### Renvoie
</div>

`Promise`\<`Appel`>

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:902](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L902)

***

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

▸ **getCallStack**(): `CallStack`

<div id="returns">
  #### Renvoie
</div>

`CallStack`

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:1482](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L1482)

***

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

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

<div id="parameters">
  #### Paramètres
</div>

| Nom        | Type                                               |
| :--------- | :------------------------------------------------- |
| `options?` | [`GetCallsOptions`](../interfaces/getcallsoptions) |

<div id="returns">
  #### Renvoie
</div>

`Promise`\<`Appel`\[]>

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:935](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L935)

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

<div id="parameters">
  #### Paramètres
</div>

| Nom             | Type                                       |
| :-------------- | :----------------------------------------- |
| `options?`      | [`CallsFilter`](../interfaces/callsfilter) |
| `includeCosts?` | `boolean`                                  |
| `limit?`        | `number`                                   |

<div id="returns">
  #### Renvoie
</div>

`Promise`\<`Appel`\[]>

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:936](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L936)

***

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

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

<div id="parameters">
  #### Paramètres
</div>

| Nom             | Type                                       |
| :-------------- | :----------------------------------------- |
| `options?`      | [`CallsFilter`](../interfaces/callsfilter) |
| `includeCosts?` | `boolean`                                  |
| `limit?`        | `number`                                   |

<div id="returns">
  #### Renvoie
</div>

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

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:957](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L957)

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

<div id="parameters">
  #### Paramètres
</div>

| Nom        | Type                                               |
| :--------- | :------------------------------------------------- |
| `options?` | [`GetCallsOptions`](../interfaces/getcallsoptions) |

<div id="returns">
  #### Renvoie
</div>

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

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:962](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L962)

***

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

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

<div id="returns">
  #### Renvoie
</div>

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

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:1486](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L1486)

***

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

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

Lie une version publiée du prompt à un portefeuille du registre.

<div id="parameters">
  #### Paramètres
</div>

| Nom       | Type                          |
| :-------- | :---------------------------- |
| `prompt`  | `RegistryLinkable`            |
| `options` | `LinkPromptToRegistryOptions` |

<div id="returns">
  #### Renvoie
</div>

`Promise`\<`LinkAssetToRegistryRes`>

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:1181](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L1181)

***

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

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

<div id="parameters">
  #### Paramètres
</div>

| Nom      | Type     |
| :------- | :------- |
| `obj`    | `any`    |
| `objId?` | `string` |

<div id="returns">
  #### Renvoie
</div>

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

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:890](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L890)

***

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

▸ **pushNewCall**(): `objet`

<div id="returns">
  #### Renvoie
</div>

`objet`

| Nom           | Type             |
| :------------ | :--------------- |
| `currentCall` | `CallStackEntry` |
| `newStack`    | `CallStack`      |
| `parentCall?` | `CallStackEntry` |

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:1490](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L1490)

***

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

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

<div id="type-parameters">
  #### Paramètres de type
</div>

| Nom |
| :-- |
| `T` |

<div id="parameters">
  #### Paramètres
</div>

| Nom          | Type                       |
| :----------- | :------------------------- |
| `attributes` | `Record`\<`string`, `any`> |
| `fn`         | () => `T`                  |

<div id="returns">
  #### Renvoie
</div>

`T`

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:1498](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L1498)

***

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

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

<div id="type-parameters">
  #### Paramètres de type
</div>

| Nom |
| :-- |
| `T` |

<div id="parameters">
  #### Paramètres
</div>

| Nom         | Type        |
| :---------- | :---------- |
| `callStack` | `CallStack` |
| `fn`        | () => `T`   |

<div id="returns">
  #### Renvoie
</div>

`T`

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:1494](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L1494)

***

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

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

<div id="parameters">
  #### Paramètres
</div>

| Nom       | Type                       |
| :-------- | :------------------------- |
| `callEnd` | `EndedCallSchemaForInsert` |

<div id="returns">
  #### Renvoie
</div>

`void`

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:1477](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L1477)

***

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

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

<div id="parameters">
  #### Paramètres
</div>

| Nom         | Type                         |
| :---------- | :--------------------------- |
| `callStart` | `StartedCallSchemaForInsert` |

<div id="returns">
  #### Renvoie
</div>

`void`

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:1472](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L1472)

***

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

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

<div id="parameters">
  #### Paramètres
</div>

| Nom      | Type                                            |
| :------- | :---------------------------------------------- |
| `op`     | [`Op`](../#op)\<(...`args`: `any`\[]) => `any`> |
| `objId?` | `string`                                        |

<div id="returns">
  #### Renvoie
</div>

`Promise`\<`OpRef`>

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:1537](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L1537)

***

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

▸ **searchAgents**(`options`): `Promise`\<[`Réponse`](../#response)\<`SearchAgentsResult`>>

Recherche en texte intégral dans les messages des agents du projet. Renvoie les correspondances
regroupées par conversation, avec un aperçu de chaque message correspondant.

`query` est le terme de recherche en texte intégral. Passez une chaîne vide pour récupérer
tous les messages correspondant aux filtres structurés (`agentName`,
`conversationId`, `traceId`) sans tenir compte d’une correspondance textuelle. Utilisez `limit` /
`offset` pour paginer les résultats.

<div id="parameters">
  #### Paramètres
</div>

| Nom       | Type                  |
| :-------- | :-------------------- |
| `options` | `SearchAgentsOptions` |

<div id="returns">
  #### Renvoie
</div>

`Promise`\<[`Réponse`](../#response)\<`SearchAgentsResult`>>

`Exemple`

```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="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:730](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L730)

***

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

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

Téléversez des octets audio bruts dans le stockage de contenu Weave, puis renvoyez l’espace réservé `CustomWeaveType` qui peut être intégré dans la sortie d’un appel.

Utilisez cette méthode lorsque vous créez manuellement des sorties d’appel (par ex. via `saveCallEnd`) et que le pipeline de sérialisation automatique de `finishCall` n’est pas utilisé.

<div id="parameters">
  #### Paramètres
</div>

| Nom         | Type                         | Valeur par défaut    | Description                                                                   |
| :---------- | :--------------------------- | :------------------- | :---------------------------------------------------------------------------- |
| `data`      | `Buffer`\<`ArrayBufferLike`> | `undefined`          | Octets audio bruts (WAV pour une compatibilité optimale avec les navigateurs) |
| `audioType` | `"wav"`                      | `DEFAULT_AUDIO_TYPE` | Format de fichier — actuellement, seul « wav » est pris en charge             |

<div id="returns">
  #### Renvoie
</div>

`Promise`\<`SerializedFileBlob`>

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:1424](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L1424)

***

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

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

<div id="parameters">
  #### Paramètres
</div>

| Nom           | Type     |
| :------------ | :------- |
| `callId`      | `string` |
| `displayName` | `string` |

<div id="returns">
  #### Renvoie
</div>

`Promise`\<`void`>

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:1710](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L1710)

***

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

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

<div id="returns">
  #### Renvoie
</div>

`Promise`\<`void`>

<div id="defined-in">
  #### Défini dans
</div>

[src/weaveClient.ts:801](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/weaveClient.ts#L801)
