Table of contents
Constructors
Properties
Methods
- addScore
- createCall
- finishCall
- finishCallWithException
- get
- getCall
- getCallStack
- getCalls
- getCallsIterator
- getCurrentAttributes
- linkPromptToRegistry
- publish
- pushNewCall
- runWithAttributes
- runWithCallStack
- saveCallEnd
- saveCallStart
- saveOp
- serializeAudio
- updateCall
- waitForBatchProcessing
Constructors
constructor
• new WeaveClient(traceServerApi, wandbServerApi, projectId, settings?): WeaveClient
Parameters
| Name | Type |
|---|---|
traceServerApi | Api<any> |
wandbServerApi | WandbServerApi |
projectId | string |
settings | Settings |
Returns
WeaveClient
Defined in
weaveClient.ts:190Properties
projectId
• projectId:string
Defined in
weaveClient.ts:193settings
• settings:Settings
Defined in
weaveClient.ts:194traceServerApi
• traceServerApi:Api<any>
Defined in
weaveClient.ts:191Methods
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:1132createCall
▸ 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:979finishCall
▸ 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:1039finishCallWithException
▸ 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:1079get
▸ get(ref): Promise<any>
Parameters
| Name | Type |
|---|---|
ref | ObjectRef |
Returns
Promise<any>
Defined in
weaveClient.ts:435getCall
▸ getCall(callId, includeCosts?): Promise<Call>
Parameters
| Name | Type | Default value |
|---|---|---|
callId | string | undefined |
includeCosts | boolean | false |
Returns
Promise<Call>
Defined in
weaveClient.ts:312getCallStack
▸ getCallStack():CallStack
Returns
CallStack
Defined in
weaveClient.ts:890getCalls
▸ getCalls(options?): Promise<Call[]>
Parameters
| Name | Type |
|---|---|
options? | GetCallsOptions |
Returns
Promise<Call[]>
Defined in
weaveClient.ts:345 ▸ getCalls(options?, includeCosts?, limit?): Promise<Call[]>
Parameters
| Name | Type |
|---|---|
options? | CallsFilter |
includeCosts? | boolean |
limit? | number |
Returns
Promise<Call[]>
Defined in
weaveClient.ts:346getCallsIterator
▸ getCallsIterator(options?, includeCosts?, limit?): AsyncIterableIterator<CallSchema>
Parameters
| Name | Type |
|---|---|
options? | CallsFilter |
includeCosts? | boolean |
limit? | number |
Returns
AsyncIterableIterator<CallSchema>
Defined in
weaveClient.ts:367 ▸ getCallsIterator(options?): AsyncIterableIterator<CallSchema>
Parameters
| Name | Type |
|---|---|
options? | GetCallsOptions |
Returns
AsyncIterableIterator<CallSchema>
Defined in
weaveClient.ts:372getCurrentAttributes
▸ getCurrentAttributes():Record<string, any>
Returns
Record<string, any>
Defined in
weaveClient.ts:894linkPromptToRegistry
▸ linkPromptToRegistry(prompt, options): Promise<LinkAssetToRegistryRes>
Link a published prompt version into a registry portfolio.
Parameters
| Name | Type |
|---|---|
prompt | RegistryLinkable |
options | LinkPromptToRegistryOptions |
Returns
Promise<LinkAssetToRegistryRes>
Defined in
weaveClient.ts:591publish
▸ publish(obj, objId?): Promise<ObjectRef>
Parameters
| Name | Type |
|---|---|
obj | any |
objId? | string |
Returns
Promise<ObjectRef>
Defined in
weaveClient.ts:300pushNewCall
▸ pushNewCall():Object
Returns
Object
| Name | Type |
|---|---|
currentCall | CallStackEntry |
newStack | CallStack |
parentCall? | CallStackEntry |
Defined in
weaveClient.ts:898runWithAttributes
▸ runWithAttributes<T>(attributes, fn): T
Type parameters
| Name |
|---|
T |
Parameters
| Name | Type |
|---|---|
attributes | Record<string, any> |
fn | () => T |
Returns
T
Defined in
weaveClient.ts:906runWithCallStack
▸ runWithCallStack<T>(callStack, fn): T
Type parameters
| Name |
|---|
T |
Parameters
| Name | Type |
|---|---|
callStack | CallStack |
fn | () => T |
Returns
T
Defined in
weaveClient.ts:902saveCallEnd
▸ saveCallEnd(callEnd): void
Parameters
| Name | Type |
|---|---|
callEnd | EndedCallSchemaForInsert |
Returns
void
Defined in
weaveClient.ts:885saveCallStart
▸ saveCallStart(callStart): void
Parameters
| Name | Type |
|---|---|
callStart | StartedCallSchemaForInsert |
Returns
void
Defined in
weaveClient.ts:880saveOp
▸ saveOp(op, objId?): Promise<OpRef>
Parameters
| Name | Type |
|---|---|
op | Op<(…args: any[]) => any> |
objId? | string |
Returns
Promise<OpRef>
Defined in
weaveClient.ts:945serializeAudio
▸ serializeAudio(data, audioType?): Promise<SerializedFileBlob>
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<SerializedFileBlob>
Defined in
weaveClient.ts:832updateCall
▸ updateCall(callId, displayName): Promise<void>
Parameters
| Name | Type |
|---|---|
callId | string |
displayName | string |
Returns
Promise<void>
Defined in
weaveClient.ts:1115waitForBatchProcessing
▸ waitForBatchProcessing():Promise<void>
Returns
Promise<void>