Skip to content

toResponsesInput

function toResponsesInput(messages, provider?): object;

Defined in: core/src/providers/responses.ts:198

Flatten a history into instructions plus the input item list.

This shape has no system role. The system prompt is a top-level instructions string, and everything else is items. One assistant turn can become several items (its text, then one function_call per tool it asked for), which is why a message maps to a list rather than to one item.

Parameter Type Default value
messages readonly ChatMessage[] undefined
provider string "openai-responses"

object

input: unknown[];
optional instructions?: string;