MistralClient.Models (mistralex_ai v0.1.0)
View SourceCore data structures for the Mistral AI client.
This module defines structs and types that represent the various data structures used throughout the Mistral API, providing type safety and clear documentation of expected data formats.
Message Types
Message
- Chat message with role and contentToolCall
- Function/tool call within a messageToolCallFunction
- Function details for a tool call
Response Types
ChatCompletion
- Complete chat responseChatCompletionChoice
- Individual choice in chat responseChatCompletionMessage
- Message in chat completionUsage
- Token usage informationEmbeddingResponse
- Embedding generation responseEmbedding
- Individual embedding data
Model Types
Model
- Model informationModelPermission
- Model access permissions
File Types
File
- File metadataFileUpload
- File upload response
Usage
# Create a message
message = %MistralClient.Models.Message{
role: "user",
content: "Hello, world!"
}
# Parse a chat completion response
{:ok, completion} = MistralClient.Models.ChatCompletion.from_map(response_data)