- TypeScript
- Python
LaminarClient
HTTP client for Laminar API operations.| Name | Type | Default | Description |
|---|---|---|---|
projectApiKey | string | LMNR_PROJECT_API_KEY env | API key |
baseUrl | string | https://api.lmnr.ai | API base URL |
port | number | 443 | API port |
client.tags.tag(traceId, tags)
Add tags to a completed trace.| Name | Type | Default | Description |
|---|---|---|---|
traceId | string | — | Trace UUID |
tags | string[] | string | — | Tag(s) to add |
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.| Name | Type | Default | Description |
|---|---|---|---|
traceId | string | — | Trace UUID, or a 32-char OTel hex trace id |
metadata | Record<string, unknown> | — | Patch merged into existing trace metadata. Must be non-empty |
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
Rollout session management and SSE connections for rollout debugging.client.rolloutSessions.connect(options)
Connect to a rollout session and return the SSE streaming response.Parameters:| Name | Type | Default | Description |
|---|---|---|---|
options.sessionId | string | — | Rollout session UUID |
options.name | string | — | Rollout entrypoint name |
options.params | RolloutParam[] | — | Entrypoint parameter metadata |
options.signal | AbortSignal | — | Abort signal for the request |
Promise<Response>client.rolloutSessions.setStatus(options)
Update the rollout session status.Parameters:| Name | Type | Default | Description |
|---|---|---|---|
options.sessionId | string | — | Rollout session UUID |
options.status | 'PENDING' | 'RUNNING' | 'FINISHED' | 'STOPPED' | — | New status |
Promise<void>client.rolloutSessions.sendSpanUpdate(options)
Stream span updates to the rollout session.Parameters:| Name | Type | Default | Description |
|---|---|---|---|
options.sessionId | string | — | Rollout session UUID |
options.span | object | — | Span payload (OTel IDs and attributes) |
Promise<void>Span payload:| Name | Type | Description |
|---|---|---|
name | string | Span name |
startTime | string | ISO timestamp |
spanId | string | OTel span ID |
traceId | string | OTel trace ID |
parentSpanId | string | undefined | Parent span ID |
attributes | Record<string, any> | Span attributes |
spanType | SpanType | Span type |
client.rolloutSessions.delete(options)
Delete a rollout session.Parameters:| Name | Type | Default | Description |
|---|---|---|---|
options.sessionId | string | — | Rollout session UUID |
Promise<void>client.datasets
Dataset operations.client.datasets.listDatasets()
Returns:Promise<Dataset[]>client.datasets.getDatasetByName(name)
Parameters:| Name | Type | Default | Description |
|---|---|---|---|
name | string | — | Dataset name |
Promise<Dataset[]>client.datasets.pull(options)
Pull datapoints from a dataset.Parameters:| Name | Type | Default | Description |
|---|---|---|---|
options.name | string | — | Dataset name |
options.id | string | — | Dataset ID |
options.limit | number | 100 | Max datapoints |
options.offset | number | 0 | Pagination offset |
Promise<GetDatapointsResponse<D, T>>client.datasets.push(options)
Push datapoints to a dataset.Parameters:| Name | Type | Default | Description |
|---|---|---|---|
options.points | Datapoint<D, T>[] | — | Datapoints to push |
options.name | string | — | Dataset name |
options.id | string | — | Dataset ID |
options.batchSize | number | 100 | Batch size |
options.createDataset | boolean | false | Create dataset if missing |
Promise<PushDatapointsResponse | undefined>client.evals
Evaluation operations.client.evals.init(name?, groupName?, metadata?)
Parameters:| Name | Type | Default | Description |
|---|---|---|---|
name | string | — | Evaluation name |
groupName | string | — | Group name |
metadata | Record<string, any> | — | Evaluation metadata |
Promise<InitEvaluationResponse>client.evals.createDatapoint(options)
Parameters:| Name | Type | Default | Description |
|---|---|---|---|
options.evalId | string | — | Evaluation UUID |
options.data | any | — | Input data |
options.target | any | — | Target/expected output |
options.metadata | Record<string, any> | — | Datapoint metadata |
options.index | number | — | Dataset index |
options.traceId | string | — | Trace UUID |
Promise<string>client.evaluators.score(options)
Attach evaluator score to a trace or span.traceId or spanId.| Name | Type | Default | Description |
|---|---|---|---|
options.name | string | — | Evaluator name |
options.score | number | — | Score value |
options.metadata | Record<string, any> | — | Score metadata |
options.traceId | string | — | Trace UUID |
options.spanId | string | — | Span UUID |
Promise<void>client.agent.run(options)
Run a browser agent.| Name | Type | Default | Description |
|---|---|---|---|
prompt | string | — | Agent instruction (required) |
parentSpanContext | string | Current span | Parent trace context |
model | string | — | Model to use |
stream | boolean | false | Stream responses |
maxSteps | number | 100 | Maximum steps |
startUrl | string | — | Starting URL |
timeout | number | — | Timeout in ms |
returnScreenshots | boolean | false | Include screenshots |
returnAgentState | boolean | false | Return agent state |
returnStorageState | boolean | false | Return storage state |
disableGiveControl | boolean | false | Disable “give control” |
enableThinking | boolean | true | Enable thinking |
Promise<AgentOutput>whenstreamisfalsePromise<ReadableStream<RunAgentResponseChunk>>whenstreamistrue
