Create a Run
Start executing a new Run
A Run can be started with an initial prompt (human
message).
Options
initialPrompt
An initial prompt for the run (human
message) .
name
A human readable name for the run, this will be shown in the Runs pane of the Playground.
If none is provided, one will be generated automatically based on the initialPrompt
.
config
If the configuration should be inherited from a Run Configuration.
resultSchema
By default, a Run’s result object shape is at the discretion of the model. A specific output structure can be enforced by providing a resultSchema
value in JSON Schema form.
The Run will be forced to return a result in the provided format or null
if this is not possible.
onStatusChange
As an alternative to retrieving a Run result via the API or calling the SDK’s poll()
function, you can provide an Inferable function as a handler which will be called each time the status of the run changes.
Using an onStatusChange
handler to receive Run results provides the same durability guarantees as any other Inferable function, this is especially helpful in the case of Runs which may take some time to complete or pause for approval.
When registering an onStatusChange
handler via the SDK, the function must accept an object in the correct format.
Each SDK provides a helper type for registering the onStatusChange
handler
attachedFunctions
By default, a Run will have access to all functions within the cluster (including the Standard Library, you can explicitly attach a set of desired functions by setting the attachedFunctions
property.
metadata
Key-Value metadata which can be attached to the run. Runs are queryable by these values using the API.
Metadata is useful for maintaining a relation between Inferable Runs and entities within your systems, for example, attaching an orderId
or customerId
to Runs.
context
Context object which is passed to all calls in the run along with any values returned from default.handleCustomerAuth
This is useful for varying the behavior of a function based on the context of the run.
reasoningTraces
When enabled, the Run will produce a reasoning
trace for each function call.
Defaults to true.
callSummarization
When enabled, the Run will attempt to auto-summarize functionr results that are too large (>10k characters) to include in the agent context.
Defaults to true.
interactive
When disabled, the run will not allow additional messages to be added.
Defaults to true.
Headers
Path Parameters
Body
An initial 'human' message to trigger the run
A system prompt for the run.
The name of the run, if not provided it will be generated
The model identifier for the run
claude-3-5-sonnet
, claude-3-5-sonnet:beta
, claude-3-haiku
A JSON schema definition which the result object should conform to. By default the result will be a JSON object which does not conform to any schema
An array of functions to make available to the run. By default all functions in the cluster will be available
Mechanism for receiving notifications when the run status changes
Run metadata which can be used to filter runs
When provided, the run will be marked as as a test / evaluation
Additional context to propogate to all calls in the run
DEPRECATED
Enable reasoning traces
Enable summarization of oversized call results
Allow the run to be continued with follow-up messages / message edits
Response
The id of the newly created run
Was this page helpful?