Cortex · Prompt and contextConversation history (
Conversation history (Message[] input)
A run’s input is a string, sent as one user message; a Message[], added as it is after the prompt; or any other value, sent as JSON in one user message. Cortex keeps nothing between runs, so an earlier conversation is passed in as messages.
await desk.preview([
{ role: 'user', content: 'How many seats are left on Saturday?' },
{ role: 'assistant', content: '113 seats are left on Saturday.' },
{ role: 'user', content: 'And on Sunday?' },
], { llm });
await desk.preview({ night: '2026-10-25', seats: 2 }, { llm });{
messages: [
'user How many seats are left on Saturday?',
'assistant 113 seats are left on Saturday.',
'user And on Sunday?',
],
value: ['user {"night":"2026-10-25","seats":2}'],
}Runs in this page on the installed package. The input and the expected output are defined by the example.