Properties
projectId
projectId: string
Defined in: src/weaveClient.ts:456
settings
settings: Settings
Defined in: src/weaveClient.ts:457
traceServerApi
traceServerApi:Defined in: src/weaveClient.ts:455Api<any>
Methods
addScore()
addScore(Defined in: src/weaveClient.ts:1727 Add a scorer result (e.g., scorer output) to a call. Used in imperative evaluation to attach scorer results to predict calls.predictCallId,scorerCallId,runnableRefUri,scorerOutput):Promise<string>
Parameters
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>
createCall()
createCall(Defined in: src/weaveClient.ts:1570internalCall,opRef,params,parameterNames,thisArg,currentCall,parentCall,startTime,displayName?,attributes?):Promise<void>
Parameters
internalCall
InternalCall
opRef
any
params
any[]
parameterNames
ParameterNamesOption
thisArg
any
currentCall
CallStackEntry
parentCall
CallStackEntry | undefined
startTime
Date
displayName?
string
attributes?
Record<string, any>
Returns
Promise<void>
finishCall()
finishCall(Defined in: src/weaveClient.ts:1630call,result,currentCall,parentCall,summarize,endTime,startCallPromise):Promise<void>
Parameters
call
InternalCall
result
any
currentCall
CallStackEntry
parentCall
CallStackEntry | undefined
summarize
((result) => Record<string, any>) | undefined
endTime
Date
startCallPromise
Promise<void>
Returns
Promise<void>
finishCallWithException()
finishCallWithException(Defined in: src/weaveClient.ts:1672call,error,currentCall,parentCall,endTime,startCallPromise):Promise<void>
Parameters
call
InternalCall
error
any
currentCall
CallStackEntry
parentCall
CallStackEntry | undefined
endTime
Date
startCallPromise
Promise<void>
Returns
Promise<void>
get()
get(Defined in: src/weaveClient.ts:1025ref):Promise<any>
Parameters
ref
ObjectRef
Returns
Promise<any>
getAgentCustomAttributes()
getAgentCustomAttributes(Defined in: src/weaveClient.ts:772 Discover typed custom-attribute keys observed on agent spans in the project. Each result row is oneoptions):Promise<Response<GetAgentCustomAttributesResult>>
(source, key, value_type) triple plus
a count of how many spans carry it, which is what the spans
query/group/stats APIs use to reference custom attrs.
Filter the spans considered by passing query (a structured span
filter), startedAfter / startedBefore (ISO-8601), or both. Use
limit / offset to page through the discovered keys.
Parameters
options
GetAgentCustomAttributesOptions
Returns
Promise<Response<GetAgentCustomAttributesResult>>
Example
getAgents()
getAgents(Defined in: src/weaveClient.ts:488 List agents with aggregated stats.options?):Promise<Response<GetAgentsResult>>
Parameters
options?
GetAgentsOptions = {}
Returns
Promise<Response<GetAgentsResult>>
Example
getAgentSpans()
getAgentSpans(Defined in: src/weaveClient.ts:566 Query agent spans, optionally filtered by agent name and/or a mongo-style query expression.options):Promise<Response<GetAgentSpansResult>>
Parameters
options
GetAgentSpansOptions
Returns
Promise<Response<GetAgentSpansResult>>
Examples
getAgentSpanStats()
getAgentSpanStats(Defined in: src/weaveClient.ts:621 Agregations over agent spans in the project, returned as rows + column metadata suitable for time-series / bucketed visualizations.options):Promise<Response<GetAgentSpanStatsResult>>
start (required) and end define the time window. Each entry in
metrics declares a field to extract and how to aggregate it (sum,
avg, count, percentiles, etc.). Pass granularity (seconds) to
bucket rows by time, or groupBy to break results out per agent /
provider / model / etc. query filters the underlying spans before
aggregation.
Parameters
options
GetAgentSpanStatsOptions
Returns
Promise<Response<GetAgentSpanStatsResult>>
Example
getAgentTurn()
getAgentTurn(Defined in: src/weaveClient.ts:655 Get data (including messages) for a single turn (by traceId).options):Promise<Response<AgentTraceChatRes>>
Parameters
options
GetAgentTurnOptions
Returns
Promise<Response<AgentTraceChatRes>>
Example
getAgentTurns()
getAgentTurns(Defined in: src/weaveClient.ts:688 Get data (including messages) for many turns (by conversationId).options):Promise<Response<GetAgentTurnsResult>>
Parameters
options
GetAgentTurnsOptions
Returns
Promise<Response<GetAgentTurnsResult>>
Example
getAgentVersions()
getAgentVersions(Defined in: src/weaveClient.ts:522 List versions for a given agent.options):Promise<Response<GetAgentVersionsResult>>
Parameters
options
GetAgentVersionsOptions
Returns
Promise<Response<GetAgentVersionsResult>>
Example
getCall()
getCall(Defined in: src/weaveClient.ts:902callId,includeCosts?):Promise<Call>
Parameters
callId
string
includeCosts?
boolean = false
Returns
Promise<Call>
getCalls()
Call Signature
getCalls(Defined in: src/weaveClient.ts:935options?):Promise<Call[]>
Parameters
options?
GetCallsOptions
Returns
Promise<Call[]>
Call Signature
getCalls(Defined in: src/weaveClient.ts:936options?,includeCosts?,limit?):Promise<Call[]>
Parameters
options?
CallsFilter
includeCosts?
boolean
limit?
number
Returns
Promise<Call[]>
getCallsIterator()
Call Signature
getCallsIterator(Defined in: src/weaveClient.ts:957options?,includeCosts?,limit?):AsyncIterableIterator<CallSchema>
Parameters
options?
CallsFilter
includeCosts?
boolean
limit?
number
Returns
AsyncIterableIterator<CallSchema>
Call Signature
getCallsIterator(Defined in: src/weaveClient.ts:962options?):AsyncIterableIterator<CallSchema>
Parameters
options?
GetCallsOptions
Returns
AsyncIterableIterator<CallSchema>
getCallStack()
getCallStack(): CallStack
Defined in: src/weaveClient.ts:1482
Returns
CallStack
getCurrentAttributes()
getCurrentAttributes():Defined in: src/weaveClient.ts:1486Record<string,any>
Returns
Record<string, any>
linkPromptToRegistry()
linkPromptToRegistry(Defined in: src/weaveClient.ts:1181 Link a published prompt version into a registry portfolio.prompt,options):Promise<LinkAssetToRegistryRes>
Parameters
prompt
RegistryLinkable
options
LinkPromptToRegistryOptions
Returns
Promise<LinkAssetToRegistryRes>
publish()
publish(Defined in: src/weaveClient.ts:890obj,objId?):Promise<ObjectRef>
Parameters
obj
any
objId?
string
Returns
Promise<ObjectRef>
pushNewCall()
pushNewCall(): object
Defined in: src/weaveClient.ts:1490
Returns
object
currentCall
currentCall: CallStackEntry
newStack
newStack: CallStack
parentCall?
optionalparentCall?:CallStackEntry
runWithAttributes()
runWithAttributes<Defined in: src/weaveClient.ts:1498T>(attributes,fn):T
Type Parameters
T
T
Parameters
attributes
Record<string, any>
fn
() =>T
Returns
T
runWithCallStack()
runWithCallStack<Defined in: src/weaveClient.ts:1494T>(callStack,fn):T
Type Parameters
T
T
Parameters
callStack
CallStack
fn
() =>T
Returns
T
saveCallEnd()
saveCallEnd(Defined in: src/weaveClient.ts:1477callEnd):void
Parameters
callEnd
EndedCallSchemaForInsert
Returns
void
saveCallStart()
saveCallStart(Defined in: src/weaveClient.ts:1472callStart):void
Parameters
callStart
StartedCallSchemaForInsert
Returns
void
saveOp()
saveOp(Defined in: src/weaveClient.ts:1537op,objId?):Promise<OpRef>
Parameters
op
Op<(…args) => any>
objId?
string
Returns
Promise<OpRef>
searchAgents()
searchAgents(Defined in: src/weaveClient.ts:730 Full-text search across agent messages in the project. Returns hits grouped by conversation, with a preview of each matched message.options):Promise<Response<SearchAgentsResult>>
query is the full-text search term. Pass an empty string to retrieve
all messages matching the structured filters (agentName,
conversationId, traceId) without text matching. Use limit /
offset to page through results.
Parameters
options
SearchAgentsOptions
Returns
Promise<Response<SearchAgentsResult>>
Example
serializeAudio()
serializeAudio(Defined in: src/weaveClient.ts:1424 Upload raw audio bytes to the Weave content store and return thedata,audioType?):Promise<SerializedFileBlob>
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
data
Buffer
Raw audio bytes (WAV for best browser compatibility)
audioType?
"wav" = DEFAULT_AUDIO_TYPE
File format — currently only ‘wav’ is supported
Returns
Promise<SerializedFileBlob>
updateCall()
updateCall(Defined in: src/weaveClient.ts:1710callId,displayName):Promise<void>
Parameters
callId
string
displayName
string
Returns
Promise<void>
waitForBatchProcessing()
waitForBatchProcessing():Defined in: src/weaveClient.ts:801Promise<void>
Returns
Promise<void>