Skip to main content

Documentation Index

Fetch the complete documentation index at: https://wb-21fd5541-update-reference-docs-37.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

weave / WeaveClient

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new WeaveClient(traceServerApi, wandbServerApi, projectId, settings?): WeaveClient

Parameters

NameType
traceServerApiApi<any>
wandbServerApiWandbServerApi
projectIdstring
settingsSettings

Returns

WeaveClient

Defined in

weaveClient.ts:177

Properties

projectId

projectId: string

Defined in

weaveClient.ts:180

settings

settings: Settings

Defined in

weaveClient.ts:181

traceServerApi

traceServerApi: Api<any>

Defined in

weaveClient.ts:178

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

NameTypeDescription
predictCallIdstringID of the predict call to attach feedback to
scorerCallIdstringID of the scorer call that generated the feedback
runnableRefUristringURI of the scorer (Op or Object ref)
scorerOutputanyOutput of the scorer

Returns

Promise<string>

Defined in

weaveClient.ts:1107

createCall

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

Parameters

NameType
internalCallInternalCall
opRefany
paramsany[]
parameterNamesParameterNamesOption
thisArgany
currentCallCallStackEntry
parentCallundefined | CallStackEntry
startTimeDate
displayName?string
attributes?Record<string, any>

Returns

Promise<void>

Defined in

weaveClient.ts:962

finishCall

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

Parameters

NameType
callInternalCall
resultany
currentCallCallStackEntry
parentCallundefined | CallStackEntry
summarizeundefined | (result: any) => Record<string, any>
endTimeDate
startCallPromisePromise<void>

Returns

Promise<void>

Defined in

weaveClient.ts:1014

finishCallWithException

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

Parameters

NameType
callInternalCall
errorany
currentCallCallStackEntry
parentCallundefined | CallStackEntry
endTimeDate
startCallPromisePromise<void>

Returns

Promise<void>

Defined in

weaveClient.ts:1054

get

get(ref): Promise<any>

Parameters

NameType
refObjectRef

Returns

Promise<any>

Defined in

weaveClient.ts:422

getCall

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

Parameters

NameTypeDefault value
callIdstringundefined
includeCostsbooleanfalse

Returns

Promise<Call>

Defined in

weaveClient.ts:299

getCallStack

getCallStack(): CallStack

Returns

CallStack

Defined in

weaveClient.ts:873

getCalls

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

Parameters

NameType
options?GetCallsOptions

Returns

Promise<Call[]>

Defined in

weaveClient.ts:332 getCalls(options?, includeCosts?, limit?): Promise<Call[]>

Parameters

NameType
options?CallsFilter
includeCosts?boolean
limit?number

Returns

Promise<Call[]>

Defined in

weaveClient.ts:333

getCallsIterator

getCallsIterator(options?, includeCosts?, limit?): AsyncIterableIterator<CallSchema>

Parameters

NameType
options?CallsFilter
includeCosts?boolean
limit?number

Returns

AsyncIterableIterator<CallSchema>

Defined in

weaveClient.ts:354 getCallsIterator(options?): AsyncIterableIterator<CallSchema>

Parameters

NameType
options?GetCallsOptions

Returns

AsyncIterableIterator<CallSchema>

Defined in

weaveClient.ts:359

getCurrentAttributes

getCurrentAttributes(): Record<string, any>

Returns

Record<string, any>

Defined in

weaveClient.ts:877

linkPromptToRegistry

linkPromptToRegistry(prompt, options): Promise<LinkAssetToRegistryRes> Link a published prompt version into a registry portfolio.

Parameters

NameType
promptRegistryLinkable
optionsLinkPromptToRegistryOptions

Returns

Promise<LinkAssetToRegistryRes>

Defined in

weaveClient.ts:578

publish

publish(obj, objId?): Promise<ObjectRef>

Parameters

NameType
objany
objId?string

Returns

Promise<ObjectRef>

Defined in

weaveClient.ts:287

pushNewCall

pushNewCall(): Object

Returns

Object
NameType
currentCallCallStackEntry
newStackCallStack
parentCall?CallStackEntry

Defined in

weaveClient.ts:881

runWithAttributes

runWithAttributes<T>(attributes, fn): T

Type parameters

Name
T

Parameters

NameType
attributesRecord<string, any>
fn() => T

Returns

T

Defined in

weaveClient.ts:889

runWithCallStack

runWithCallStack<T>(callStack, fn): T

Type parameters

Name
T

Parameters

NameType
callStackCallStack
fn() => T

Returns

T

Defined in

weaveClient.ts:885

saveCallEnd

saveCallEnd(callEnd): void

Parameters

NameType
callEndEndedCallSchemaForInsert

Returns

void

Defined in

weaveClient.ts:868

saveCallStart

saveCallStart(callStart): void

Parameters

NameType
callStartStartedCallSchemaForInsert

Returns

void

Defined in

weaveClient.ts:863

saveOp

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

Parameters

NameType
opOp<(…args: any[]) => any>
objId?string

Returns

Promise<OpRef>

Defined in

weaveClient.ts:928

serializeAudio

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

NameTypeDefault valueDescription
dataBufferundefinedRaw audio bytes (WAV for best browser compatibility)
audioType"wav"DEFAULT_AUDIO_TYPEFile format — currently only ‘wav’ is supported

Returns

Promise<SerializedFileBlob>

Defined in

weaveClient.ts:815

updateCall

updateCall(callId, displayName): Promise<void>

Parameters

NameType
callIdstring
displayNamestring

Returns

Promise<void>

Defined in

weaveClient.ts:1090

waitForBatchProcessing

waitForBatchProcessing(): Promise<void>

Returns

Promise<void>

Defined in

weaveClient.ts:198