POST
/
clusters
/
{clusterId}
/
runs

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.

config: {
  id: 'XXXXXXXX' // ID of the Run Configuration
  input: {} // Optional: Structured Input
}

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.

"resultSchema": {
  "type": "object",
  "properties": {
    "orderId": {
      "type": "string"
    },
    "required": [
      "orderId"
    ]
  }
}

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

// NodeJS
import { onStatusChangeSchema } from "inferable";
const onStatusChange = client.default.register({
  name: "onStatusChangeFn",
  schema: statusChangeSchema,
  func: (input) => {},
});
// .Net
using Inferable;
var Func = new Func<OnStatusChangeInput<MyRunResult>, object?>((input) => {}),
// Go
Func := func(input OnStatusChangeInput) string {},
{
  "onStatusChange": {
    "function": {
      "function": "result",
      "service": "default"
    }
  },
}

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.

"attachedFunctions": [
  {
    "service": "default",
    "function": "myFunctionName"
  },
  {
    "service": "inferable",
    "function": "accessKnowledgeArtifacts"
  }
]

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.

"metadata": {
  "orderId": "abc-123"
}

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.

client.default.register({
  name: "checkTime",
  func: async (_input, context) => {
    //{
    //  runContext: {
    //    timeZone: "Australia/Adelaide"
    //  },
    //   authContext: null
    //}
    cosnole.log(context);
  },
});

const run = await client.run({
  initialPrompt: "What is the current time?",
  context: {
    timeZone: "Australia/Adelaide",
  },
});

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

authorization
string
required

Path Parameters

clusterId
string
required

Body

application/json
initialPrompt
string

An initial 'human' message to trigger the run

systemPrompt
string

A system prompt for the run.

name
string

The name of the run, if not provided it will be generated

model
enum<string>

The model identifier for the run

Available options:
claude-3-5-sonnet,
claude-3-5-sonnet:beta,
claude-3-haiku
resultSchema
object

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

attachedFunctions
object[]

An array of functions to make available to the run. By default all functions in the cluster will be available

onStatusChange
object

Mechanism for receiving notifications when the run status changes

metadata
object

Run metadata which can be used to filter runs

test
object

When provided, the run will be marked as as a test / evaluation

config
object
context
object

Additional context to propogate to all calls in the run

template
object

DEPRECATED

reasoningTraces
boolean
default: true

Enable reasoning traces

callSummarization
boolean
default: true

Enable summarization of oversized call results

interactive
boolean
default: true

Allow the run to be continued with follow-up messages / message edits

Response

201 - application/json
id
string
required

The id of the newly created run