MistralResponse
Defined in: adapters/mistral.ts:110
Mistral AI API response structure.
OpenAI-compatible response format with Mistral-specific finish reasons. Includes generated message and token usage statistics.
- MistralRequest
- MistralMessage
Example
Section titled “Example”const response: MistralResponse = { id: 'cmpl-123', object: 'chat.completion', created: 1677652288, model: 'mistral-small', choices: [{ index: 0, message: { role: 'assistant', content: 'Hello! How can I help?' }, finish_reason: 'stop' }], usage: { prompt_tokens: 10, completion_tokens: 6, total_tokens: 16 }};Properties
Section titled “Properties”choices
Section titled “choices”choices:
object[]
Defined in: adapters/mistral.ts:124
Array of completion choices (usually one)
finish_reason
Section titled “finish_reason”finish_reason:
"stop"|"length"|"model_length"|null
Stop reason: ‘stop’, ‘length’, ‘model_length’, or null
index:
number
Choice index
message
Section titled “message”message:
MistralMessage
Generated message
created
Section titled “created”created:
number
Defined in: adapters/mistral.ts:118
Unix timestamp of creation
id:
string
Defined in: adapters/mistral.ts:112
Unique completion identifier
model:
string
Defined in: adapters/mistral.ts:121
Model used for generation
object
Section titled “object”object:
"chat.completion"
Defined in: adapters/mistral.ts:115
Object type - always ‘chat.completion’
usage:
object
Defined in: adapters/mistral.ts:136
Token usage statistics
completion_tokens
Section titled “completion_tokens”completion_tokens:
number
Tokens in completion
prompt_tokens
Section titled “prompt_tokens”prompt_tokens:
number
Tokens in prompt
total_tokens
Section titled “total_tokens”total_tokens:
number
Total tokens used