- TypeScript
- Python
LaminarClient
HTTP client for Laminar API operations.Resources:
client.tags.tag(traceId, tags)
Add tags to a completed trace.Returns:
Promise<any>Note: Call after Laminar.flush() to ensure trace exists.client.traces.pushMetadata(traceId, metadata)
Push a metadata patch to a finished trace. The patch is shallow-merged into the trace’s existing metadata server-side. Use it for post-hoc signals (quality scores, reviewer notes, edit counts) you compute after the trace ends.Returns:
Promise<void>Note: Call after Laminar.flush() to ensure the trace exists. If the trace can’t be found at processing time, the call logs a warning and returns without raising. The patch increments the trace’s numSpans by 1 (the virtual span that carried the patch) but does not change endTime, tokens, cost, top span, tags, or span names.client.rolloutSessions
Debugger session management. The SDK andlmnr-cli call these for you during a debugger run; reach for them directly only when you script against a debug session yourself. The resource keeps its rollout name for backward compatibility, and it is the same session you see in the debugger UI.client.rolloutSessions.register(options)
Idempotently create (upsert) a debug session so it shows up in the UI. Omittingname never overwrites a name set elsewhere.Parameters:Returns:
Promise<string | null>: the project id resolved from the API key, or null if the response can’t be parsed.client.rolloutSessions.addBlock(options)
Append a block to a debug session.trace and evaluation blocks are written by the backend at ingest, so the usual use is a text block: a standalone note tied to the session, the same thing lmnr-cli debug session add-note posts.Parameters:Returns:
Promise<string | null>: the created block id, or null if the session was not found or the response can’t be parsed.client.rolloutSessions.listBlocks(options)
List a debug session’s blocks in creation order, the same data the debugger UI renders.Parameters:Returns:
Promise<SessionBlock[]>client.rolloutSessions.delete(options)
Delete a debug session.Parameters:Returns:
Promise<void>Note: client.rolloutSessions.cache(...) also exists. It is the replay cache lookup the instrumentations call during a cached replay and is not meant to be called directly.client.rolloutSessions.setName(...) only works with lmnr-cli user authentication and returns a 404 for a client created with a project API key. To name or rename a session with a project API key, call register with a name.client.datasets
Dataset operations.client.datasets.listDatasets()
Returns:Promise<Dataset[]>client.datasets.getDatasetByName(name)
Parameters:Returns:
Promise<Dataset[]>client.datasets.pull(options)
Pull datapoints from a dataset.Parameters:Returns:
Promise<GetDatapointsResponse<D, T>>client.datasets.push(options)
Push datapoints to a dataset.Parameters:Returns:
Promise<PushDatapointsResponse | undefined>client.evals
Evaluation operations.client.evals.init(name?, groupName?, metadata?)
Parameters:Returns:
Promise<InitEvaluationResponse>client.evals.createDatapoint(options)
Parameters:Returns:
Promise<string>client.evaluators.score(options)
Attach evaluator score to a trace or span.traceId or spanId.Returns:
Promise<void>