Index SDK Reference
Index SDK Reference
Laminar SDKs are available for JavaScript/TypeScript and Python. Index SDK is the SDK for calling the Index API. All index calls from SDK can be traced as described in the index tracing docs.
SDKs call the streaming API, regardless of the stream
parameter in the SDK request.
This is because the non-streaming API has a timeout limitation. SDKs will transform the streaming
response into a non-streaming response.
Agent Run
Request
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
prompt | string | Yes | - | The prompt text to send to the agent |
stream | boolean | No | false | Whether to stream the response from the agent |
parentSpanContext / parent_span_context | string | No | - | Stringified Laminar span context for tracing |
modelProvider / model_provider | Enum | No | - | The model provider to use (anthropic, gemini, openai) |
model | string | No | - | The specific model to use (must set modelProvider) |
enableThinking / enable_thinking | boolean | No | false | Whether to enable thinking (passed to LLM provider) |
timeout | integer | No | - | Soft timeout in seconds for the agent run |
maxSteps / max_steps | integer | No | 100 | Maximum number of steps the agent will take |
cdpUrl / cdp_url | string | No | - | URL to a running browser with CDP |
thinkingTokenBudget / thinking_token_budget | integer | No | - | Maximum tokens for agent thinking |
startUrl / start_url | string | No | - | Starting URL for the agent to visit |
agentState / agent_state | string | No | - | Stringified agent state from previous run |
storageState / storage_state | string | No | - | Stringified browser storage state |
returnScreenshots / return_screenshots | boolean | No | false | Whether to return screenshots with each step |
returnAgentState / return_agent_state | boolean | No | false | Whether to return agent state after run |
returnStorageState / return_storage_state | boolean | No | false | Whether to return browser storage state |
prompt
The prompt to the agent. Required.
Type | Required |
---|---|
string | Yes |
stream
Whether to stream the response from the agent. This affects the response shape.
Type | Required | Default |
---|---|---|
boolean | No | false |
parentSpanContext / parent_span_context
The stringified Laminar span context that can be used to place the trace in an existing trace.
Type | Required |
---|---|
string | No |
modelProvider
The model provider to use for the agent.
Type | Required |
---|---|
Enum[‘anthropic’, ‘gemini’, ‘openai’] | No |
It is required to set the modelProvider
if you set the model
.
model
The model to use for the agent. Must match an available model (with vision) in the modelProvider
’s API.
See models for available models.
Type | Required |
---|---|
string | No |
It is required to set the modelProvider
if you set the model
.
enableThinking / enable_thinking
The param is passed to the underlying LLM provider. Only used for Anthropic.
Type | Required | Default |
---|---|---|
boolean | No | false |
For OpenAI, reasoning_effort
is currently defaulted to low
, regardless of this param.
Gemini models always set this to true
.
timeout
Timeout in seconds. This is a soft timeout, the agent will continue its current step until completion after the timeout. Also, initialization of the agent is not included in the timeout.
Type | Required |
---|---|
integer | No |
In non-streaming mode, agent timing out will throw an error.
maxSteps / max_steps
The maximum number of steps the agent will take.
Type | Required | Default |
---|---|---|
integer | No | None (currently defaulted to 100 in the backend) |
cdpUrl / cdp_url
If you have a running browser with CDP, you can pass the URL to the browser here. By default, Laminar will start and manage its own browser instance.
Type | Required |
---|---|
string | No |
thinkingTokenBudget / thinking_token_budget
The maximum number of tokens the agent will use for thinking. Passed to the underlying LLM provider.
Currently, there is a heuristic that converts the token budget to a reasoning effort parameter for OpenAI.
Type | Required |
---|---|
integer | No |
startUrl / start_url
The URL to start the agent on. If not specified, the agent infers the URL from the prompt.
Type | Required |
---|---|
string | No |
agentState / agent_state
The stringified agent state as returned by a previous agent run. This is useful for continuing the agent run in a subsequent call.
Type | Required |
---|---|
string | No |
Agent state is a very large object.
storageState / storage_state
The stringified browser storage state (auth, cookies, etc.) as returned by a previous agent run. This is useful for continuing the agent run in a subsequent call.
Type | Required |
---|---|
string | No |
This may be a very large object.
returnScreenshots / return_screenshots
Whether to return a screenshot of the page with each step.
Type | Required | Default |
---|---|---|
boolean | No | false |
This will not have any effect on non-streaming runs.
returnAgentState / return_agent_state
Whether to return the agent state after the run. This is useful for continuing the agent run in a subsequent call.
Type | Required | Default |
---|---|---|
boolean | No | false |
Agent state is a very large object
returnStorageState / return_storage_state
Whether to return the browser storage state (auth, cookies, etc.) after the run. This is useful for continuing the agent run in a subsequent call.
Type | Required | Default |
---|---|---|
boolean | No | false |
Storage state may be a very large object