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§
- Chat
Choice - One completion alternative.
- Chat
Request - A chat completion request.
- Chat
Response - A chat completion response.
- Delta
- Embedding
- Embeddings
Request - A vector embedding request.
- Embeddings
Response - Message
- One chat message.
contentis aValueso multimodal parts and tool results pass through unchanged. - Model
Info - Nabu
Gate Client - Client for a NabuGate deployment.
- Stream
Choice - Stream
Chunk - 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.