Skip to main content

Crate nabugate

Crate nabugate 

Source
Expand description

Official Rust client for NabuGate, the OpenAI-compatible AI gateway.

The gateway passes request bodies through to the upstream provider untouched, so ChatRequest carries an extra map alongside its typed fields. Anything placed there reaches the provider as-is, which means a new provider parameter needs no release of this crate.

use nabugate::{ChatRequest, Message, NabuGateClient};

let client = NabuGateClient::new(std::env::var("NABUGATE_API_KEY").unwrap());
let text = client
    .complete_text(ChatRequest::new(vec![Message::user("Summarise this quarter.")]))
    .await?;
println!("{text}");

Structs§

ChatChoice
One completion alternative.
ChatRequest
A chat completion request.
ChatResponse
A chat completion response.
Delta
Embedding
EmbeddingsRequest
A vector embedding request.
EmbeddingsResponse
Message
One chat message. content is a Value so multimodal parts and tool results pass through unchanged.
ModelInfo
NabuGateClient
Client for a NabuGate deployment.
StreamChoice
StreamChunk
One server-sent event from a streaming completion.
Usage
Token consumption for a request.

Enums§

Error
Anything that can go wrong talking to the gateway.

Constants§

DEFAULT_BASE_URL
The hosted gateway.