IRChatRequest
Defined in: packages/ai.matey.types/src/ir.ts:669
Universal chat completion request.
This is the normalized format that all frontend adapters convert to and all backend adapters consume.
Example
Section titled “Example”const request: IRChatRequest = { messages: [ { role: 'system', content: 'You are helpful.' }, { role: 'user', content: 'Hello!' } ], parameters: { model: 'gpt-4', temperature: 0.7, maxTokens: 1000 }, metadata: { requestId: 'req_abc123', timestamp: Date.now(), provenance: { frontend: 'openai' } }, stream: false};Properties
Section titled “Properties”messages
Section titled “messages”
readonlymessages: readonlyIRMessage[]
Defined in: packages/ai.matey.types/src/ir.ts:674
Conversation messages. Must contain at least one message.
metadata
Section titled “metadata”
readonlymetadata:IRMetadata
Defined in: packages/ai.matey.types/src/ir.ts:699
Request metadata.
parameters?
Section titled “parameters?”
readonlyoptionalparameters:IRParameters
Defined in: packages/ai.matey.types/src/ir.ts:694
Request parameters.
stream?
Section titled “stream?”
readonlyoptionalstream:boolean
Defined in: packages/ai.matey.types/src/ir.ts:705
Whether to stream the response.
Default
Section titled “Default”falsestreamMode?
Section titled “streamMode?”
readonlyoptionalstreamMode:StreamMode
Defined in: packages/ai.matey.types/src/ir.ts:722
Preferred streaming mode (hint to backend).
delta: Request incremental chunks only (most efficient)accumulated: Request full accumulated text in each chunk
This is a preference hint - backends may choose to:
- Provide only delta (always safe, universal)
- Provide both delta and accumulated (maximum flexibility)
- Provide only accumulated (if that’s native format)
Frontends and wrappers can convert between modes as needed.
Default
Section titled “Default”'delta'toolChoice?
Section titled “toolChoice?”
readonlyoptionaltoolChoice:"none"| {name:string; } |"auto"|"required"
Defined in: packages/ai.matey.types/src/ir.ts:689
Tool choice strategy.
- ‘auto’: Model decides whether to call tools
- ‘required’: Model must call a tool
- ‘none’: Model cannot call tools
- { name: string }: Force specific tool
tools?
Section titled “tools?”
readonlyoptionaltools: readonlyIRTool[]
Defined in: packages/ai.matey.types/src/ir.ts:680
Tool/function definitions. Optional, for function calling.