/** * LangSmith Observability Adapter * * Delivers traces to LangSmith via its REST Runs API. Like the Langfuse * adapter, `isEnabled` is derived from a live transport rather than hardcoded: * it is true only after initialize() has validated an API key and built an * HTTP client. Until then (and if no key is configured) every span is recorded * in the in-memory adapter and nowhere else. * * Transport uses the `axios` dependency already shipped by this package, so no * new dependency and no vendor SDK is required. Run POST/PATCH requests are * queued and flushed asynchronously; the hot path never awaits vendor HTTP. * * Configuration (secrets are read from the environment only, never logged): * - LANGSMITH_API_KEY or LANGCHAIN_API_KEY (required to deliver) * - LANGSMITH_ENDPOINT or LANGCHAIN_ENDPOINT (optional, must be http(s)) * - LANGSMITH_PROJECT or LANGCHAIN_PROJECT (optional project name) */ import type { ObservabilityAdapter, TraceContext, SpanContext, SpanKind, SpanStatus, AttributionContext, ObservabilityToolConfig } from '../../types'; export declare class LangSmithObservabilityAdapter implements ObservabilityAdapter { readonly name = "langsmith"; /** This adapter has a real delivery implementation. */ readonly delivers: boolean; /** * True only when a validated HTTP client exists. A missing API key, or a * non-http(s) endpoint, leaves this false so callers are never told their * traces are delivered when they are not. */ get isEnabled(): boolean; private client; private endpoint; private project?; private memory; private config; private runs; private seqByTrace; private dottedBySpan; private queue; private deliveryErrors; constructor(config?: ObservabilityToolConfig); initialize(): Promise; shutdown(): Promise; private nextSeq; private enqueue; /** Drop a run's bookkeeping once it has ended so long processes stay bounded. */ private evict; startTrace(name: string, metadata?: Record, attribution?: AttributionContext): TraceContext; endTrace(traceId: string, status?: SpanStatus): void; startSpan(traceId: string, name: string, kind: SpanKind, parentId?: string): SpanContext; endSpan(spanId: string, status?: SpanStatus, attributes?: Record): void; addEvent(spanId: string, name: string, attributes?: Record): void; recordError(spanId: string, error: Error): void; flush(): Promise; private postRun; private patchRun; }