> ## 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.

# Class: WeaveClient

> TypeScript SDK reference

[weave](../) / WeaveClient

## Table of contents

### Constructors

* [constructor](./weaveclient#constructor)

### Properties

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

### Methods

* [addScore](./weaveclient#addscore)
* [createCall](./weaveclient#createcall)
* [finishCall](./weaveclient#finishcall)
* [finishCallWithException](./weaveclient#finishcallwithexception)
* [get](./weaveclient#get)
* [getCall](./weaveclient#getcall)
* [getCallStack](./weaveclient#getcallstack)
* [getCalls](./weaveclient#getcalls)
* [getCallsIterator](./weaveclient#getcallsiterator)
* [getCurrentAttributes](./weaveclient#getcurrentattributes)
* [publish](./weaveclient#publish)
* [pushNewCall](./weaveclient#pushnewcall)
* [runWithAttributes](./weaveclient#runwithattributes)
* [runWithCallStack](./weaveclient#runwithcallstack)
* [saveCallEnd](./weaveclient#savecallend)
* [saveCallStart](./weaveclient#savecallstart)
* [saveOp](./weaveclient#saveop)
* [serializeAudio](./weaveclient#serializeaudio)
* [updateCall](./weaveclient#updatecall)
* [waitForBatchProcessing](./weaveclient#waitforbatchprocessing)

## Constructors

### constructor

• **new WeaveClient**(`traceServerApi`, `wandbServerApi`, `projectId`, `settings?`): [`WeaveClient`](./weaveclient)

#### Parameters

| Name             | Type             |
| :--------------- | :--------------- |
| `traceServerApi` | `Api`\<`any`>    |
| `wandbServerApi` | `WandbServerApi` |
| `projectId`      | `string`         |
| `settings`       | `Settings`       |

#### Returns

[`WeaveClient`](./weaveclient)

#### Defined in

[weaveClient.ts:100](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L100)

## Properties

### projectId

• **projectId**: `string`

#### Defined in

[weaveClient.ts:103](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L103)

***

### settings

• **settings**: `Settings`

#### Defined in

[weaveClient.ts:104](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L104)

***

### traceServerApi

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

#### Defined in

[weaveClient.ts:101](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L101)

## Methods

### addScore

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

Add a scorer result (e.g., scorer output) to a call.
Used in imperative evaluation to attach scorer results to predict calls.

#### Parameters

| Name             | Type     | Description                                       |
| :--------------- | :------- | :------------------------------------------------ |
| `predictCallId`  | `string` | ID of the predict call to attach feedback to      |
| `scorerCallId`   | `string` | ID of the scorer call that generated the feedback |
| `runnableRefUri` | `string` | URI of the scorer (Op or Object ref)              |
| `scorerOutput`   | `any`    | Output of the scorer                              |

#### Returns

`Promise`\<`string`>

#### Defined in

[weaveClient.ts:908](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L908)

***

### createCall

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

#### Parameters

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

#### Returns

`Promise`\<`void`>

#### Defined in

[weaveClient.ts:763](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L763)

***

### finishCall

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

#### Parameters

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

#### Returns

`Promise`\<`void`>

#### Defined in

[weaveClient.ts:815](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L815)

***

### finishCallWithException

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

#### Parameters

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

#### Returns

`Promise`\<`void`>

#### Defined in

[weaveClient.ts:855](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L855)

***

### get

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

#### Parameters

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

#### Returns

`Promise`\<`any`>

#### Defined in

[weaveClient.ts:289](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L289)

***

### getCall

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

#### Parameters

| Name           | Type      | Default value |
| :------------- | :-------- | :------------ |
| `callId`       | `string`  | `undefined`   |
| `includeCosts` | `boolean` | `false`       |

#### Returns

`Promise`\<`Call`>

#### Defined in

[weaveClient.ts:220](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L220)

***

### getCallStack

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

#### Returns

`CallStack`

#### Defined in

[weaveClient.ts:674](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L674)

***

### getCalls

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

#### Parameters

| Name           | Type                                       | Default value |
| :------------- | :----------------------------------------- | :------------ |
| `filter`       | [`CallsFilter`](../interfaces/callsfilter) | `{}`          |
| `includeCosts` | `boolean`                                  | `false`       |
| `limit`        | `number`                                   | `1000`        |

#### Returns

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

#### Defined in

[weaveClient.ts:230](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L230)

***

### getCallsIterator

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

#### Parameters

| Name           | Type                                       | Default value |
| :------------- | :----------------------------------------- | :------------ |
| `filter`       | [`CallsFilter`](../interfaces/callsfilter) | `{}`          |
| `includeCosts` | `boolean`                                  | `false`       |
| `limit`        | `number`                                   | `1000`        |

#### Returns

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

#### Defined in

[weaveClient.ts:244](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L244)

***

### getCurrentAttributes

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

#### Returns

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

#### Defined in

[weaveClient.ts:678](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L678)

***

### publish

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

#### Parameters

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

#### Returns

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

#### Defined in

[weaveClient.ts:208](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L208)

***

### pushNewCall

▸ **pushNewCall**(): `Object`

#### Returns

`Object`

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

#### Defined in

[weaveClient.ts:682](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L682)

***

### runWithAttributes

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

#### Type parameters

| Name |
| :--- |
| `T`  |

#### Parameters

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

#### Returns

`T`

#### Defined in

[weaveClient.ts:690](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L690)

***

### runWithCallStack

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

#### Type parameters

| Name |
| :--- |
| `T`  |

#### Parameters

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

#### Returns

`T`

#### Defined in

[weaveClient.ts:686](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L686)

***

### saveCallEnd

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

#### Parameters

| Name      | Type                       |
| :-------- | :------------------------- |
| `callEnd` | `EndedCallSchemaForInsert` |

#### Returns

`void`

#### Defined in

[weaveClient.ts:669](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L669)

***

### saveCallStart

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

#### Parameters

| Name        | Type                         |
| :---------- | :--------------------------- |
| `callStart` | `StartedCallSchemaForInsert` |

#### Returns

`void`

#### Defined in

[weaveClient.ts:664](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L664)

***

### saveOp

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

#### Parameters

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

#### Returns

`Promise`\<`any`>

#### Defined in

[weaveClient.ts:729](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L729)

***

### serializeAudio

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

Upload raw audio bytes to the Weave content store and return the
`CustomWeaveType` placeholder that can be embedded in a call output.

Use this when building call outputs manually (e.g. via `saveCallEnd`)
where the automatic serialization pipeline from `finishCall` is not used.

#### Parameters

| Name        | Type     | Default value        | Description                                          |
| :---------- | :------- | :------------------- | :--------------------------------------------------- |
| `data`      | `Buffer` | `undefined`          | Raw audio bytes (WAV for best browser compatibility) |
| `audioType` | `"wav"`  | `DEFAULT_AUDIO_TYPE` | File format — currently only 'wav' is supported      |

#### Returns

`Promise`\<`any`>

#### Defined in

[weaveClient.ts:616](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L616)

***

### updateCall

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

#### Parameters

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

#### Returns

`Promise`\<`void`>

#### Defined in

[weaveClient.ts:891](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L891)

***

### waitForBatchProcessing

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

#### Returns

`Promise`\<`void`>

#### Defined in

[weaveClient.ts:121](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L121)
