Skip to main content

속성

projectId

projectId: string

settings

settings: object

attributes

readonly attributes: Record<string, any>
이 클라이언트가 생성하는 모든 트레이스에 적용되는 속성의 맵입니다.

genai

readonly genai: object
optional batchOptions: BufferConfig
BatchSpanProcessor 설정입니다. spanProcessor === 'batch'인 경우에만 적용되며, 그 외에는 무시됩니다.
optional spanProcessor: "batch" | "simple" | SpanProcessor
GenAI span을 내보내는 방식입니다.
  • 'batch' (기본값): BatchSpanProcessor를 사용하며, 프로덕션 에이전트와 장기 실행 프로세스에 적합합니다.
  • 'simple': SimpleSpanProcessor를 사용하며, span마다 HTTP POST 요청을 한 번씩 보냅니다. 처리량보다 결정적인 플러시가 더 중요한 테스트나 단기 실행 CLI에 유용합니다.
  • SpanProcessor 인스턴스: 사용자가 직접 제공하는 프로세서입니다. 프로세서의 라이프사이클은 호출자가 관리하며, /agents/otel/v1/traces를 대상으로 하는 Weave OTLP 익스포터는 사용되지 않습니다.
readonly printCallLink: boolean
Op의 Weave UI 링크를 터미널에 출력합니다. true

useCallsComplete

useCallsComplete: boolean
완료된 Call을 calls/complete endpoint로 전송합니다(start+end를 클라이언트 측에서 페어링). 레거시 call/upsert_batch 경로 대신 사용합니다. true

useOTelV2

useOTelV2: boolean
OTel 지원 인테그레이션을 해당 OTel 변형을 통해 라우팅합니다. true

traceServerApi

traceServerApi: Api<any>

메서드

addScore()

addScore(predictCallId, scorerCallId, runnableRefUri, scorerOutput): Promise<string>
Scorer 결과(예: Scorer 출력)를 Call에 추가합니다. 명령형 평가에서 predict Call에 Scorer 결과를 연결하는 데 사용됩니다.

매개변수

string
필수
피드백을 연결할 predict call의 ID
string
필수
피드백을 생성한 Scorer call의 ID
string
필수
Scorer의 URI (Op 또는 Object ref)
any
필수
Scorer의 출력

반환값

Promise<string>

createCall()

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

매개변수

InternalCall
필수
any
필수
any[]
필수
undefined | "useParam0Object" | string[]
필수
any
필수
object
필수
{…} | undefined
필수
전체 유형: { callId: string; childSummary: Record<string, any>; displayName?: string; opName?: string; traceId: string; } | undefined
Date
필수
string
Record<string, any>
boolean = false

반환값

Promise<void>

finishCall()

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

매개변수

InternalCall
필수
any
필수
object
필수
{…} | undefined
필수
전체 유형: { callId: string; childSummary: Record<string, any>; displayName?: string; opName?: string; traceId: string; } | undefined
((result) => Record<string, any>) | undefined
필수
Date
필수
Promise<void>
필수

반환값

Promise<void>

finishCallWithException()

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

매개변수

InternalCall
필수
any
필수
object
필수
{…} | undefined
필수
전체 유형: { callId: string; childSummary: Record<string, any>; displayName?: string; opName?: string; traceId: string; } | undefined
Date
필수
Promise<void>
필수

반환값

Promise<void>

flush()

flush(): Promise<void>
버퍼에 있는 모든 Call을 서버로 전송합니다. process.exit()를 호출하기 전에 이 메서드를 await하세요.

반환값

Promise<void>

get()

get(ref): Promise<any>

매개변수

ObjectRef
필수
ObjectRef를 참조하세요.

반환값

Promise<any>

getAgentCustomAttributes()

getAgentCustomAttributes(options): Promise<Response<{ attributes?: object[]; has_more?: boolean; limit?: number; offset?: number; }>>
프로젝트의 에이전트 span에서 관찰된 유형 지정 맞춤형 속성 키를 검색합니다. 각 결과 행은 하나의 (source, key, value_type) 트리플과 해당 트리플을 가진 span 수로 구성됩니다. 이 트리플은 span 쿼리/그룹/통계 API에서 맞춤형 속성을 참조할 때 사용하는 형식입니다. query(구조화된 span 필터)나 startedAfter / startedBefore(ISO-8601), 또는 둘 다를 전달하여 대상 span을 필터링하세요. 검색된 키를 페이지 단위로 조회하려면 limit / offset을 사용하세요.

매개변수

object
필수

반환값

Promise<Response<{ attributes?: object[]; has_more?: boolean; limit?: number; offset?: number; }>>

예시


getAgents()

getAgents(options?): Promise<Response<GetAgentsResult>>
집계된 통계와 함께 에이전트 목록을 조회합니다.

매개변수

GetAgentsOptions = {}
GetAgentsOptions를 참조하세요.

반환값

Promise<Response<GetAgentsResult>>

예시


getAgentSpans()

getAgentSpans(options): Promise<Response<GetAgentSpansResult>>
에이전트 span을 쿼리합니다. 필요에 따라 에이전트 이름, mongo 스타일 쿼리 표현식 또는 둘 다를 사용해 필터링할 수 있습니다.

매개변수

GetAgentSpansOptions
필수
GetAgentSpansOptions를 참조하세요.

반환값

Promise<Response<GetAgentSpansResult>>

예시


getAgentSpanStats()

getAgentSpanStats(options): Promise<Response<{ bucket_type?: "number" | "time"; columns?: object[]; end: string; granularity?: number | null; rows?: Record<string, string | number | boolean | null>[]; start: string; timezone: string; }>>
프로젝트 내 에이전트 span을 집계합니다. 결과는 시계열 및 버킷 기반 시각화에 적합한 행과 열 메타데이터 형태로 반환됩니다. start(필수)와 end로 시간 윈도우를 지정합니다. metrics의 각 항목에는 추출할 필드와 해당 필드의 집계 방식(sum, avg, count, 백분위수 등)을 선언합니다. 행을 시간 단위 버킷으로 묶으려면 granularity(초)를 전달하고, 에이전트, 공급자, 모델 등을 기준으로 결과를 나누려면 groupBy를 전달하세요. query는 집계 전에 대상 span을 필터링합니다.

매개변수

object
필수

반환값

Promise<Response<{ bucket_type?: "number" | "time"; columns?: object[]; end: string; granularity?: number | null; rows?: Record<string, string | number | boolean | null>[]; start: string; timezone: string; }>>

예시


getAgentTurn()

getAgentTurn(options): Promise<Response<{ agent_name?: string | null; agent_version?: string | null; feedback?: Record<string, any>[] | null; messages?: object[]; provider?: string | null; root_span_name?: string | null; status_code?: "UNSET" | "OK" | "ERROR" | null; total_cost_usd?: number | null; total_duration_ms?: number | null; trace_id: string; }>>
traceId로 단일 턴의 데이터(메시지 포함)를 조회합니다.

매개변수

GetAgentTurnOptions
필수
GetAgentTurnOptions를 참조하세요.

반환값

Promise<Response<{ agent_name?: string | null; agent_version?: string | null; feedback?: Record<string, any>[] | null; messages?: object[]; provider?: string | null; root_span_name?: string | null; status_code?: "UNSET" | "OK" | "ERROR" | null; total_cost_usd?: number | null; total_duration_ms?: number | null; trace_id: string; }>>

예시


getAgentTurns()

getAgentTurns(options): Promise<Response<GetAgentTurnsResult>>
conversationId를 기준으로 여러 턴의 데이터(메시지 포함)를 조회합니다.

매개변수

GetAgentTurnsOptions
필수
GetAgentTurnsOptions를 참조하세요.

반환값

Promise<Response<GetAgentTurnsResult>>

예시


getAgentVersions()

getAgentVersions(options): Promise<Response<GetAgentVersionsResult>>
지정한 에이전트의 버전 목록을 조회합니다.

매개변수

GetAgentVersionsOptions
필수
GetAgentVersionsOptions를 참조하세요.

반환값

Promise<Response<GetAgentVersionsResult>>

예시


getCall()

getCall(callId, includeCosts?): Promise<{ attributes: Record<string, any>; deleted_at?: string | null; display_name?: string | null; ended_at?: string | null; exception?: string | null; expire_at?: string | null; id: string; inputs: Record<string, any>; op_name: string; output?: null; parent_id?: string | null; project_id: string; started_at: string; storage_size_bytes?: number | null; summary?: Record<string, any>; thread_id?: string | null; total_storage_size_bytes?: number | null; trace_id: string; turn_id?: string | null; wb_run_id?: string | null; wb_run_step?: number | null; wb_run_step_end?: number | null; wb_user_id?: string | null; wb_username?: string | null; setDisplayName: Promise<void>; }>

매개변수

string
필수
boolean = false

반환값

Promise<{ attributes: Record<string, any>; deleted_at?: string | null; display_name?: string | null; ended_at?: string | null; exception?: string | null; expire_at?: string | null; id: string; inputs: Record<string, any>; op_name: string; output?: null; parent_id?: string | null; project_id: string; started_at: string; storage_size_bytes?: number | null; summary?: Record<string, any>; thread_id?: string | null; total_storage_size_bytes?: number | null; trace_id: string; turn_id?: string | null; wb_run_id?: string | null; wb_run_step?: number | null; wb_run_step_end?: number | null; wb_user_id?: string | null; wb_username?: string | null; setDisplayName: Promise<void>; }>

getCalls()

Call 시그니처

getCalls(options?): Promise<object[]>
GetCallsOptions
GetCallsOptions를 참조하세요.
Promise<object[]>

Call 시그니처

getCalls(options?, includeCosts?, limit?): Promise<object[]>
CallsFilter
CallsFilter를 참조하세요.
boolean
number
Promise<object[]>

getCallsIterator()

Call 시그니처

getCallsIterator(options?, includeCosts?, limit?): AsyncIterableIterator<CallSchema>
CallsFilter
CallsFilter를 참조하세요.
boolean
number
AsyncIterableIterator<CallSchema>

Call 시그니처

getCallsIterator(options?): AsyncIterableIterator<CallSchema>
GetCallsOptions
GetCallsOptions를 참조하세요.
AsyncIterableIterator<CallSchema>

getCallStack()

getCallStack(): CallStack

반환값

CallStack

getCurrentAttributes()

getCurrentAttributes(): Record<string, any>

반환값

Record<string, any>

linkPromptToRegistry()

linkPromptToRegistry(prompt, options): Promise<{ version_index: number | null; }>
게시된 프롬프트 버전을 레지스트리 포트폴리오에 연결합니다.

매개변수

string | ObjectRef | Prompt
필수
ObjectRef를 참조하세요.
object
필수

반환값

Promise<{ version_index: number | null; }>

pendingCallCount()

pendingCallCount(): number
클라이언트 측 버퍼에 저장되어 있지만 아직 서버에 전달되지 않은 Call입니다.

반환값

number

publish()

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

매개변수

any
필수
string

반환값

Promise<ObjectRef>

pushNewCall()

pushNewCall(): object

반환값

object
object
필수
callId: string
childSummary: Record<string, any>
optional displayName: string
optional opName: string
traceId: string
CallStack
필수
object
callId: string
childSummary: Record<string, any>
optional displayName: string
optional opName: string
traceId: string

registerCustomRuntime()

registerCustomRuntime(options): Promise<Response<{ api_key_secret: string | null; base_url: string; headers: Record<string, string>; name: string; runtime_ids: object[]; }>>
맞춤형 런타임을 등록하며, 이미 존재하는 경우 전체 설정을 교체합니다.

매개변수

RegisterCustomRuntimeOptions
필수
RegisterCustomRuntimeOptions를 참조하세요.

반환값

Promise<Response<{ api_key_secret: string | null; base_url: string; headers: Record<string, string>; name: string; runtime_ids: object[]; }>>

runWithAttributes()

runWithAttributes<T>(attributes, fn): T

유형 매개변수

매개변수

Record<string, any>
필수
() => T
필수

반환값

T

runWithCallStack()

runWithCallStack<T>(callStack, fn): T

유형 매개변수

매개변수

CallStack
필수
() => T
필수

반환값

T

saveCallEnd()

saveCallEnd(callEnd): void

매개변수

object & object
필수

반환값

void

saveCallStart()

saveCallStart(callStart, opts?): void

매개변수

object
필수
object

반환값

void

saveOp()

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

매개변수

Op<(...args) => any>
필수
Op를 참조하세요.
string

반환값

Promise<OpRef>

searchAgents()

searchAgents(options): Promise<Response<{ results: object[]; total_conversations?: number; }>>
프로젝트의 에이전트 메시지 전체에서 전체 텍스트 검색을 수행합니다. 검색 결과를 대화별로 그룹화하여 반환하며, 일치하는 각 메시지의 미리보기를 제공합니다. query는 전체 텍스트 검색어입니다. 빈 문자열을 전달하면 텍스트 일치 여부와 관계없이 구조화된 필터(agentName, conversationId, traceId)에 일치하는 모든 메시지를 가져옵니다. limit / offset을 사용하여 결과를 페이지 단위로 조회하세요.

매개변수

object
필수

반환값

Promise<Response<{ results: object[]; total_conversations?: number; }>>

예시


serializeAudio()

serializeAudio(data, audioType?): Promise<{ _type: "CustomWeaveType"; files: Record<string, string>; load_op: string; weave_type: { type: string; }; }>
원시 오디오 바이트를 Weave 콘텐츠 저장소에 업로드하고 Call 출력에 포함할 수 있는 CustomWeaveType 자리표시자를 반환합니다. finishCall의 자동 직렬화 파이프라인을 사용하지 않고 Call 출력을 수동으로 구축할 때(예: saveCallEnd 사용) 이 메서드를 사용하세요.

매개변수

Buffer
필수
원시 오디오 바이트 (브라우저 호환성을 위해 WAV 권장)
"wav" = DEFAULT_AUDIO_TYPE
파일 형식 — 현재 ‘wav’만 지원됩니다

반환값

Promise<{ _type: "CustomWeaveType"; files: Record<string, string>; load_op: string; weave_type: { type: string; }; }>

updateCall()

updateCall(callId, displayName): Promise<void>

매개변수

string
필수
string
필수

반환값

Promise<void>

waitForBatchProcessing()

waitForBatchProcessing(): Promise<void>

반환값

Promise<void>
마지막 수정일 2026년 9월 30일