types/client

Client, ClientError, and ChatFn types — LLM client configuration and helpers.

Types

pub type Client {
  Client(api_key: String, base_url: String, model: String)
}

Constructors

  • Client(api_key: String, base_url: String, model: String)
pub type ClientError {
  AuthError(status: Int, body: String)
  RateLimitError(status: Int, body: String, retry_after_ms: Int)
  ServerError(status: Int, body: String)
  ContextOverflowError(status: Int, body: String)
  PayloadTooLargeError(status: Int, body: String)
  NetworkError(message: String)
  JsonParseError(detail: String)
}

Constructors

  • AuthError(status: Int, body: String)
  • RateLimitError(status: Int, body: String, retry_after_ms: Int)
  • ServerError(status: Int, body: String)
  • ContextOverflowError(status: Int, body: String)
  • PayloadTooLargeError(status: Int, body: String)
  • NetworkError(message: String)
  • JsonParseError(detail: String)

Values

pub fn client_error_to_string(err: ClientError) -> String
pub fn new_client(api_key: String) -> Client
pub fn with_base_url(client: Client, url: String) -> Client
pub fn with_model(client: Client, model: String) -> Client
Search Document