Skip to main content
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:93

Properties

projectId

โ€ข projectId: string

Defined in

weaveClient.ts:96

settings

โ€ข settings: Settings

Defined in

weaveClient.ts:97

traceServerApi

โ€ข traceServerApi: Api<any>

Defined in

weaveClient.ts:94

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

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

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

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

get

โ–ธ get(ref): Promise<any>

Parameters

NameType
refObjectRef

Returns

Promise<any>

Defined in

weaveClient.ts:282

getCall

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

Parameters

NameTypeDefault value
callIdstringundefined
includeCostsbooleanfalse

Returns

Promise<Call>

Defined in

weaveClient.ts:213

getCallStack

โ–ธ getCallStack(): CallStack

Returns

CallStack

Defined in

weaveClient.ts:636

getCalls

โ–ธ getCalls(filter?, includeCosts?, limit?): Promise<Call[]>

Parameters

NameTypeDefault value
filterCallsFilter{}
includeCostsbooleanfalse
limitnumber1000

Returns

Promise<Call[]>

Defined in

weaveClient.ts:223

getCallsIterator

โ–ธ getCallsIterator(filter?, includeCosts?, limit?): AsyncIterableIterator<CallSchema>

Parameters

NameTypeDefault value
filterCallsFilter{}
includeCostsbooleanfalse
limitnumber1000

Returns

AsyncIterableIterator<CallSchema>

Defined in

weaveClient.ts:237

getCurrentAttributes

โ–ธ getCurrentAttributes(): Record<string, any>

Returns

Record<string, any>

Defined in

weaveClient.ts:640

publish

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

Parameters

NameType
objany
objId?string

Returns

Promise<ObjectRef>

Defined in

weaveClient.ts:201

pushNewCall

โ–ธ pushNewCall(): Object

Returns

Object
NameType
currentCallCallStackEntry
newStackCallStack
parentCall?CallStackEntry

Defined in

weaveClient.ts:644

runWithAttributes

โ–ธ runWithAttributes<T>(attributes, fn): T

Type parameters

Name
T

Parameters

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

Returns

T

Defined in

weaveClient.ts:652

runWithCallStack

โ–ธ runWithCallStack<T>(callStack, fn): T

Type parameters

Name
T

Parameters

NameType
callStackCallStack
fn() => T

Returns

T

Defined in

weaveClient.ts:648

saveOp

โ–ธ saveOp(op, objId?): Promise<any>

Parameters

NameType
opOp<(โ€ฆargs: any[]) => any>
objId?string

Returns

Promise<any>

Defined in

weaveClient.ts:686

updateCall

โ–ธ updateCall(callId, displayName): Promise<void>

Parameters

NameType
callIdstring
displayNamestring

Returns

Promise<void>

Defined in

weaveClient.ts:848

waitForBatchProcessing

โ–ธ waitForBatchProcessing(): Promise<void>

Returns

Promise<void>

Defined in

weaveClient.ts:114