gleamstral/client

Types

Client for interacting with the Mistral AI API

Contains the API key required for authentication

pub type Client {
  Client(api_key: String)
}

Constructors

  • Client(api_key: String)

Represents possible errors that can occur when interacting with the Mistral AI API

  • RateLimitExceeded: Returned when API rate limits have been reached
  • Unauthorized: Returned when API key is invalid or missing
  • Unknown: Returned for any other error, with the error message as a string
pub type Error {
  RateLimitExceeded
  Unauthorized
  Unknown(String)
}

Constructors

  • RateLimitExceeded
  • Unauthorized
  • Unknown(String)

Constants

pub const api_endpoint: String

Functions

pub fn error_decoder() -> Decoder(Error)
pub fn new(api_key: String) -> Client

Creates a new Mistral AI client with the provided API key

Example

let client = client.new("your-api-key-here")
Search Document