Passer au contenu principal
weave / WeaveClient

Table des matières

Constructeurs

Propriétés

Méthodes

Constructeurs

constructeur

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

Paramètres

NomType
traceServerApiApi<any>
wandbServerApiWandbServerApi
projectIdstring
settingsSettings

Renvoie

WeaveClient

Défini dans

weaveClient.ts:190

Propriétés

projectId

projectId: string

Défini dans

weaveClient.ts:193

settings

settings: Settings

Défini dans

weaveClient.ts:194

traceServerApi

traceServerApi: Api<any>

Défini dans

weaveClient.ts:191

Méthodes

addScore

addScore(predictCallId, scorerCallId, runnableRefUri, scorerOutput): Promise<string> Ajoute un résultat de scorer (par ex. la sortie du scorer) à un appel. Utilisé dans l’évaluation impérative pour associer les résultats du scorer aux appels de prédiction.

Paramètres

NomTypeDescription
predictCallIdstringID de l’appel predict auquel associer le retour
scorerCallIdstringID de l’appel du scorer ayant généré le retour
runnableRefUristringURI du scorer (op ou réf. d’objet)
scorerOutputanyRésultat du scorer

Renvoie

Promise<string>

Défini dans

weaveClient.ts:1132

createCall

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

Paramètres

NomType
internalCallInternalCall
opRefany
paramsany[]
parameterNamesParameterNamesOption
thisArgany
currentCallCallStackEntry
parentCallundefinedCallStackEntry
startTimeDate
displayName?string
attributes?Record<string, any>

Renvoie

Promise<void>

Défini dans

weaveClient.ts:979

finishCall

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

Paramètres

NomType
callInternalCall
resultany
currentCallCallStackEntry
parentCallundefinedCallStackEntry
summarizeundefined(result: any) => Record<string, any>
endTimeDate
startCallPromisePromise<void>

Renvoie

Promise<void>

Défini dans

weaveClient.ts:1039

finishCallWithException

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

Paramètres

NomType
callInternalCall
errorany
currentCallCallStackEntry
parentCallundefinedCallStackEntry
endTimeDate
startCallPromisePromise<void>

Renvoie

Promise<void>

Défini dans

weaveClient.ts:1079

get

get(ref): Promise<any>

Paramètres

NomType
refObjectRef

Renvoie

Promise<any>

Défini dans

weaveClient.ts:435

getCall

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

Paramètres

NomTypeValeur par défaut
callIdstringundefined
includeCostsbooleanfalse

Renvoie

Promise<Appel>

Défini dans

weaveClient.ts:312

getCallStack

getCallStack(): CallStack

Renvoie

CallStack

Défini dans

weaveClient.ts:890

getCalls

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

Paramètres

NomType
options?GetCallsOptions

Renvoie

Promise<Appel[]>

Défini dans

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

Paramètres

NomType
options?CallsFilter
includeCosts?boolean
limit?number

Renvoie

Promise<Appel[]>

Défini dans

weaveClient.ts:346

getCallsIterator

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

Paramètres

NomType
options?CallsFilter
includeCosts?boolean
limit?number

Renvoie

AsyncIterableIterator<CallSchema>

Défini dans

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

Paramètres

NomType
options?GetCallsOptions

Renvoie

AsyncIterableIterator<CallSchema>

Défini dans

weaveClient.ts:372

getCurrentAttributes

getCurrentAttributes(): Record<string, any>

Renvoie

Record<string, any>

Défini dans

weaveClient.ts:894

linkPromptToRegistry

linkPromptToRegistry(prompt, options): Promise<LinkAssetToRegistryRes> Lie une version publiée du prompt à un portefeuille du registre.

Paramètres

NomType
promptRegistryLinkable
optionsLinkPromptToRegistryOptions

Renvoie

Promise<LinkAssetToRegistryRes>

Défini dans

weaveClient.ts:591

publish

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

Paramètres

NomType
objany
objId?string

Renvoie

Promise<ObjectRef>

Défini dans

weaveClient.ts:300

pushNewCall

pushNewCall(): objet

Renvoie

objet
NomType
currentCallCallStackEntry
newStackCallStack
parentCall?CallStackEntry

Défini dans

weaveClient.ts:898

runWithAttributes

runWithAttributes<T>(attributes, fn): T

Paramètres de type

Nom
T

Paramètres

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

Renvoie

T

Défini dans

weaveClient.ts:906

runWithCallStack

runWithCallStack<T>(callStack, fn): T

Paramètres de type

Nom
T

Paramètres

NomType
callStackCallStack
fn() => T

Renvoie

T

Défini dans

weaveClient.ts:902

saveCallEnd

saveCallEnd(callEnd): void

Paramètres

NomType
callEndEndedCallSchemaForInsert

Renvoie

void

Défini dans

weaveClient.ts:885

saveCallStart

saveCallStart(callStart): void

Paramètres

NomType
callStartStartedCallSchemaForInsert

Renvoie

void

Défini dans

weaveClient.ts:880

saveOp

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

Paramètres

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

Renvoie

Promise<OpRef>

Défini dans

weaveClient.ts:945

serializeAudio

serializeAudio(data, audioType?): Promise<SerializedFileBlob> Téléversez des octets audio bruts dans le stockage de contenu Weave, puis renvoyez l’espace réservé CustomWeaveType qui peut être intégré dans la sortie d’un appel. Utilisez cette méthode lorsque vous créez manuellement des sorties d’appel (par ex. via saveCallEnd) et que le pipeline de sérialisation automatique de finishCall n’est pas utilisé.

Paramètres

NomTypeValeur par défautDescription
dataBufferundefinedOctets audio bruts (WAV pour une compatibilité optimale avec les navigateurs)
audioType"wav"DEFAULT_AUDIO_TYPEFormat de fichier — actuellement, seul « wav » est pris en charge

Renvoie

Promise<SerializedFileBlob>

Défini dans

weaveClient.ts:832

updateCall

updateCall(callId, displayName): Promise<void>

Paramètres

NomType
callIdstring
displayNamestring

Renvoie

Promise<void>

Défini dans

weaveClient.ts:1115

waitForBatchProcessing

waitForBatchProcessing(): Promise<void>

Renvoie

Promise<void>

Défini dans

weaveClient.ts:211