Table of contents
Constructors
Properties
Methods
- addScore
- createCall
- finishCall
- finishCallWithException
- get
- getCall
- getCallStack
- getCalls
- getCallsIterator
- publish
- pushNewCall
- runWithCallStack
- saveOp
- 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:92Properties
projectId
• projectId:string
Defined in
weaveClient.ts:95settings
• settings:Settings
Defined in
weaveClient.ts:96traceServerApi
• traceServerApi:Api
<any
>
Defined in
weaveClient.ts:93Methods
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:841createCall
▸ 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:701finishCall
▸ 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:748finishCallWithException
▸ 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:788get
▸ get(ref
): Promise
<any
>
Parameters
Name | Type |
---|---|
ref | ObjectRef |
Returns
Promise
<any
>
Defined in
weaveClient.ts:281getCall
▸ getCall(callId
, includeCosts?
): Promise
<Call
>
Parameters
Name | Type | Default value |
---|---|---|
callId | string | undefined |
includeCosts | boolean | false |
Returns
Promise
<Call
>
Defined in
weaveClient.ts:212getCallStack
▸ getCallStack():CallStack
Returns
CallStack
Defined in
weaveClient.ts:629getCalls
▸ getCalls(filter?
, includeCosts?
, limit?
): Promise
<Call
[]>
Parameters
Name | Type | Default value |
---|---|---|
filter | CallsFilter | {} |
includeCosts | boolean | false |
limit | number | 1000 |
Returns
Promise
<Call
[]>
Defined in
weaveClient.ts:222getCallsIterator
▸ getCallsIterator(filter?
, includeCosts?
, limit?
): AsyncIterableIterator
<CallSchema
>
Parameters
Name | Type | Default value |
---|---|---|
filter | CallsFilter | {} |
includeCosts | boolean | false |
limit | number | 1000 |
Returns
AsyncIterableIterator
<CallSchema
>
Defined in
weaveClient.ts:236publish
▸ publish(obj
, objId?
): Promise
<ObjectRef
>
Parameters
Name | Type |
---|---|
obj | any |
objId? | string |
Returns
Promise
<ObjectRef
>
Defined in
weaveClient.ts:200pushNewCall
▸ pushNewCall():Object
Returns
Object
Name | Type |
---|---|
currentCall | CallStackEntry |
newStack | CallStack |
parentCall? | CallStackEntry |
Defined in
weaveClient.ts:633runWithCallStack
▸ runWithCallStack<T
>(callStack
, fn
): T
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
callStack | CallStack |
fn | () => T |
Returns
T
Defined in
weaveClient.ts:637saveOp
▸ saveOp(op
, objId?
): Promise
<any
>
Parameters
Name | Type |
---|---|
op | Op <(…args : any []) => any > |
objId? | string |
Returns
Promise
<any
>
Defined in
weaveClient.ts:667updateCall
▸ updateCall(callId
, displayName
): Promise
<void
>
Parameters
Name | Type |
---|---|
callId | string |
displayName | string |
Returns
Promise
<void
>
Defined in
weaveClient.ts:824waitForBatchProcessing
▸ waitForBatchProcessing():Promise
<void
>
Returns
Promise
<void
>