> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-docs-1778-mysql-updates.mintlify.site/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)
* [publish](./WeaveClient#publish)
* [pushNewCall](./WeaveClient#pushnewcall)
* [runWithCallStack](./WeaveClient#runwithcallstack)
* [saveOp](./WeaveClient#saveop)
* [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:92](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L92)

## Properties

### projectId

• **projectId**: `string`

#### Defined in

[weaveClient.ts:95](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L95)

***

### settings

• **settings**: `Settings`

#### Defined in

[weaveClient.ts:96](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L96)

***

### traceServerApi

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

#### Defined in

[weaveClient.ts:93](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L93)

## 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:841](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L841)

***

### 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:701](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L701)

***

### 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:748](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L748)

***

### 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:788](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L788)

***

### get

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

#### Parameters

| Name  | Type        |
| :---- | :---------- |
| `ref` | `ObjectRef` |

#### Returns

`Promise`\<`any`>

#### Defined in

[weaveClient.ts:281](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L281)

***

### getCall

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

#### Parameters

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

#### Returns

`Promise`\<`Call`>

#### Defined in

[weaveClient.ts:212](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L212)

***

### getCallStack

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

#### Returns

`CallStack`

#### Defined in

[weaveClient.ts:629](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L629)

***

### 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:222](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L222)

***

### 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:236](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L236)

***

### publish

▸ **publish**(`obj`, `objId?`): `Promise`\<`ObjectRef`>

#### Parameters

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

#### Returns

`Promise`\<`ObjectRef`>

#### Defined in

[weaveClient.ts:200](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L200)

***

### pushNewCall

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

#### Returns

`Object`

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

#### Defined in

[weaveClient.ts:633](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L633)

***

### runWithCallStack

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

#### Type parameters

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

#### Parameters

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

#### Returns

`T`

#### Defined in

[weaveClient.ts:637](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L637)

***

### saveOp

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

#### Parameters

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

#### Returns

`Promise`\<`any`>

#### Defined in

[weaveClient.ts:667](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L667)

***

### updateCall

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

#### Parameters

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

#### Returns

`Promise`\<`void`>

#### Defined in

[weaveClient.ts:824](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L824)

***

### waitForBatchProcessing

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

#### Returns

`Promise`\<`void`>

#### Defined in

[weaveClient.ts:113](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L113)
