Table of contents
Constructors
Properties
Methods
- addScore
- createCall
- finishCall
- finishCallWithException
- get
- getCall
- getCallStack
- getCalls
- getCallsIterator
- getCurrentAttributes
- publish
- pushNewCall
- runWithAttributes
- 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:93Properties
projectId
โข projectId:string
Defined in
weaveClient.ts:96settings
โข settings:Settings
Defined in
weaveClient.ts:97traceServerApi
โข traceServerApi:Api<any>
Defined in
weaveClient.ts:94Methods
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:865createCall
โธ 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:720finishCall
โธ 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:772finishCallWithException
โธ 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:812get
โธ get(ref): Promise<any>
Parameters
| Name | Type |
|---|---|
ref | ObjectRef |
Returns
Promise<any>
Defined in
weaveClient.ts:282getCall
โธ getCall(callId, includeCosts?): Promise<Call>
Parameters
| Name | Type | Default value |
|---|---|---|
callId | string | undefined |
includeCosts | boolean | false |
Returns
Promise<Call>
Defined in
weaveClient.ts:213getCallStack
โธ getCallStack():CallStack
Returns
CallStack
Defined in
weaveClient.ts:636getCalls
โธ 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:223getCallsIterator
โธ 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:237getCurrentAttributes
โธ getCurrentAttributes():Record<string, any>
Returns
Record<string, any>
Defined in
weaveClient.ts:640publish
โธ publish(obj, objId?): Promise<ObjectRef>
Parameters
| Name | Type |
|---|---|
obj | any |
objId? | string |
Returns
Promise<ObjectRef>
Defined in
weaveClient.ts:201pushNewCall
โธ pushNewCall():Object
Returns
Object
| Name | Type |
|---|---|
currentCall | CallStackEntry |
newStack | CallStack |
parentCall? | CallStackEntry |
Defined in
weaveClient.ts:644runWithAttributes
โธ runWithAttributes<T>(attributes, fn): T
Type parameters
| Name |
|---|
T |
Parameters
| Name | Type |
|---|---|
attributes | Record<string, any> |
fn | () => T |
Returns
T
Defined in
weaveClient.ts:652runWithCallStack
โธ runWithCallStack<T>(callStack, fn): T
Type parameters
| Name |
|---|
T |
Parameters
| Name | Type |
|---|---|
callStack | CallStack |
fn | () => T |
Returns
T
Defined in
weaveClient.ts:648saveOp
โธ saveOp(op, objId?): Promise<any>
Parameters
| Name | Type |
|---|---|
op | Op<(โฆargs: any[]) => any> |
objId? | string |
Returns
Promise<any>
Defined in
weaveClient.ts:686updateCall
โธ updateCall(callId, displayName): Promise<void>
Parameters
| Name | Type |
|---|---|
callId | string |
displayName | string |
Returns
Promise<void>
Defined in
weaveClient.ts:848waitForBatchProcessing
โธ waitForBatchProcessing():Promise<void>
Returns
Promise<void>