Skip to main content
weave / WeaveClient

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new WeaveClient(«destructured»): WeaveClient

Parameters

Returns

WeaveClient

Defined in

src/weaveClient.ts:459

Properties

projectId

projectId: string

Defined in

src/weaveClient.ts:456

settings

settings: Settings

Defined in

src/weaveClient.ts:457

traceServerApi

traceServerApi: Api<any>

Defined in

src/weaveClient.ts:455

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

Returns

Promise<string>

Defined in

src/weaveClient.ts:1727

createCall

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

Parameters

Returns

Promise<void>

Defined in

src/weaveClient.ts:1570

finishCall

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

Parameters

Returns

Promise<void>

Defined in

src/weaveClient.ts:1630

finishCallWithException

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

Parameters

Returns

Promise<void>

Defined in

src/weaveClient.ts:1672

get

get(ref): Promise<any>

Parameters

Returns

Promise<any>

Defined in

src/weaveClient.ts:1025

getAgentCustomAttributes

getAgentCustomAttributes(options): Promise<Response<GetAgentCustomAttributesResult>> Discover typed custom-attribute keys observed on agent spans in the project. Each result row is one (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

Returns

Promise<Response<GetAgentCustomAttributesResult>> Example

Defined in

src/weaveClient.ts:772

getAgentSpanStats

getAgentSpanStats(options): Promise<Response<GetAgentSpanStatsResult>> Agregations over agent spans in the project, returned as rows + column metadata suitable for time-series / bucketed visualizations. 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

Returns

Promise<Response<GetAgentSpanStatsResult>> Example

Defined in

src/weaveClient.ts:621

getAgentSpans

getAgentSpans(options): Promise<Response<GetAgentSpansResult>> Query agent spans, optionally filtered by agent name and/or a mongo-style query expression.

Parameters

Returns

Promise<Response<GetAgentSpansResult>> Example
Example

Defined in

src/weaveClient.ts:566

getAgentTurn

getAgentTurn(options): Promise<Response<AgentTraceChatRes>> Get data (including messages) for a single turn (by traceId).

Parameters

Returns

Promise<Response<AgentTraceChatRes>> Example

Defined in

src/weaveClient.ts:655

getAgentTurns

getAgentTurns(options): Promise<Response<GetAgentTurnsResult>> Get data (including messages) for many turns (by conversationId).

Parameters

Returns

Promise<Response<GetAgentTurnsResult>> Example

Defined in

src/weaveClient.ts:688

getAgentVersions

getAgentVersions(options): Promise<Response<GetAgentVersionsResult>> List versions for a given agent.

Parameters

Returns

Promise<Response<GetAgentVersionsResult>> Example

Defined in

src/weaveClient.ts:522

getAgents

getAgents(options?): Promise<Response<GetAgentsResult>> List agents with aggregated stats.

Parameters

Returns

Promise<Response<GetAgentsResult>> Example

Defined in

src/weaveClient.ts:488

getCall

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

Parameters

Returns

Promise<Call>

Defined in

src/weaveClient.ts:902

getCallStack

getCallStack(): CallStack

Returns

CallStack

Defined in

src/weaveClient.ts:1482

getCalls

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

Parameters

Returns

Promise<Call[]>

Defined in

src/weaveClient.ts:935 getCalls(options?, includeCosts?, limit?): Promise<Call[]>

Parameters

Returns

Promise<Call[]>

Defined in

src/weaveClient.ts:936

getCallsIterator

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

Parameters

Returns

AsyncIterableIterator<CallSchema, any, any>

Defined in

src/weaveClient.ts:957 getCallsIterator(options?): AsyncIterableIterator<CallSchema, any, any>

Parameters

Returns

AsyncIterableIterator<CallSchema, any, any>

Defined in

src/weaveClient.ts:962

getCurrentAttributes

getCurrentAttributes(): Record<string, any>

Returns

Record<string, any>

Defined in

src/weaveClient.ts:1486

linkPromptToRegistry

linkPromptToRegistry(prompt, options): Promise<LinkAssetToRegistryRes> Link a published prompt version into a registry portfolio.

Parameters

Returns

Promise<LinkAssetToRegistryRes>

Defined in

src/weaveClient.ts:1181

publish

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

Parameters

Returns

Promise<ObjectRef>

Defined in

src/weaveClient.ts:890

pushNewCall

pushNewCall(): Object

Returns

Object

Defined in

src/weaveClient.ts:1490

runWithAttributes

runWithAttributes<T>(attributes, fn): T

Type parameters

Parameters

Returns

T

Defined in

src/weaveClient.ts:1498

runWithCallStack

runWithCallStack<T>(callStack, fn): T

Type parameters

Parameters

Returns

T

Defined in

src/weaveClient.ts:1494

saveCallEnd

saveCallEnd(callEnd): void

Parameters

Returns

void

Defined in

src/weaveClient.ts:1477

saveCallStart

saveCallStart(callStart): void

Parameters

Returns

void

Defined in

src/weaveClient.ts:1472

saveOp

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

Parameters

Returns

Promise<OpRef>

Defined in

src/weaveClient.ts:1537

searchAgents

searchAgents(options): Promise<Response<SearchAgentsResult>> Full-text search across agent messages in the project. Returns hits grouped by conversation, with a preview of each matched message. 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

Returns

Promise<Response<SearchAgentsResult>> Example

Defined in

src/weaveClient.ts:730

serializeAudio

serializeAudio(data, audioType?): Promise<SerializedFileBlob> Upload raw audio bytes to the Weave content store and return the 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

Returns

Promise<SerializedFileBlob>

Defined in

src/weaveClient.ts:1424

updateCall

updateCall(callId, displayName): Promise<void>

Parameters

Returns

Promise<void>

Defined in

src/weaveClient.ts:1710

waitForBatchProcessing

waitForBatchProcessing(): Promise<void>

Returns

Promise<void>

Defined in

src/weaveClient.ts:801