Yasminaai Rust Library
Table of Contents
Installation
Add this to yourCargo.toml:
Reference
A full reference for this library is available here.Usage
Instantiate and use the client with the following:Environments
This SDK allows you to configure different environments for API requests.Errors
When the API returns a non-success status code (4xx or 5xx response), an error will be returned.Request Types
The SDK exports all request types as Rust structs. Simply import them from the crate to access them:Advanced
Retries
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long as the request is deemed retryable and the number of retry attempts has not grown larger than the configured retry limit (default: 2). A request is deemed retryable when any of the following HTTP status codes is returned: TheretryStatusCodes configuration controls which 5XX status codes are retried:
legacy(default): Retries408,429, and all>= 500recommended: Retries408,429,502,503,504only (excludes500 Internal Server Errorto avoid retrying non-idempotent failures)
max_retries method to configure this behavior.
Timeouts
The SDK defaults to a 30 second timeout. Use thetimeout method to configure this behavior.
Additional Headers
You can add custom headers to requests usingRequestOptions.
Additional Query String Parameters
You can add custom query parameters to requests usingRequestOptions.

