Skip to main content

Documentation Index

Fetch the complete documentation index at: https://wb-21fd5541-update-reference-docs-34.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:190

Properties

projectId

projectId: string

Defined in

weaveClient.ts:193

settings

settings: Settings

Defined in

weaveClient.ts:194

traceServerApi

traceServerApi: Api<any>

Defined in

weaveClient.ts:191

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:1128

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:975

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:1035

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:1075

get

get(ref): Promise<any>

Parameters

NameType
refObjectRef

Returns

Promise<any>

Defined in

weaveClient.ts:435

getCall

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

Parameters

NameTypeDefault value
callIdstringundefined
includeCostsbooleanfalse

Returns

Promise<Call>

Defined in

weaveClient.ts:312

getCallStack

getCallStack(): CallStack

Returns

CallStack

Defined in

weaveClient.ts:886

getCalls

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

Parameters

NameType
options?GetCallsOptions

Returns

Promise<Call[]>

Defined in

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

Parameters

NameType
options?CallsFilter
includeCosts?boolean
limit?number

Returns

Promise<Call[]>

Defined in

weaveClient.ts:346

getCallsIterator

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

Parameters

NameType
options?CallsFilter
includeCosts?boolean
limit?number

Returns

AsyncIterableIterator<CallSchema>

Defined in

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

Parameters

NameType
options?GetCallsOptions

Returns

AsyncIterableIterator<CallSchema>

Defined in

weaveClient.ts:372

getCurrentAttributes

getCurrentAttributes(): Record<string, any>

Returns

Record<string, any>

Defined in

weaveClient.ts:890

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:591

publish

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

Parameters

NameType
objany
objId?string

Returns

Promise<ObjectRef>

Defined in

weaveClient.ts:300

pushNewCall

pushNewCall(): Object

Returns

Object
NameType
currentCallCallStackEntry
newStackCallStack
parentCall?CallStackEntry

Defined in

weaveClient.ts:894

runWithAttributes

runWithAttributes<T>(attributes, fn): T

Type parameters

Name
T

Parameters

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

Returns

T

Defined in

weaveClient.ts:902

runWithCallStack

runWithCallStack<T>(callStack, fn): T

Type parameters

Name
T

Parameters

NameType
callStackCallStack
fn() => T

Returns

T

Defined in

weaveClient.ts:898

saveCallEnd

saveCallEnd(callEnd): void

Parameters

NameType
callEndEndedCallSchemaForInsert

Returns

void

Defined in

weaveClient.ts:881

saveCallStart

saveCallStart(callStart): void

Parameters

NameType
callStartStartedCallSchemaForInsert

Returns

void

Defined in

weaveClient.ts:876

saveOp

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

Parameters

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

Returns

Promise<OpRef>

Defined in

weaveClient.ts:941

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:828

updateCall

updateCall(callId, displayName): Promise<void>

Parameters

NameType
callIdstring
displayNamestring

Returns

Promise<void>

Defined in

weaveClient.ts:1111

waitForBatchProcessing

waitForBatchProcessing(): Promise<void>

Returns

Promise<void>

Defined in

weaveClient.ts:211