Cortex · Output

Text output (response)

An agent without output.schema returns text in response. The run’s output is still an output envelope: response is required and is its only field. The model’s one turn is scripted as the JSON a model would send; no model is called.

Agent
const desk = defineAgent({
  id: 'desk',
  instructions: 'Answer the member in one sentence. Doors open thirty minutes before the show.',
});

const result = await desk.run('When do the doors open on Saturday?', { llm }).result;
Scripted model turns
1  writes {"response":"The doors open thirty minutes before the show, on Saturday as on any night."}
Result
{
  ok: true,
  output: {
    response: 'The doors open thirty minutes before the show, on Saturday as on any night.',
  },
}
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.