Expand description
Production-ready Chipp API client
Provides async HTTP client for interacting with the Chipp API (https://chipp.ai). Supports both non-streaming and streaming (SSE) responses with automatic retry logic.
§Features
- Non-streaming chat: Simple request/response with
chat() - Streaming chat: Server-Sent Events (SSE) with
chat_stream() - Session management: Automatic
chatSessionIdtracking for conversation continuity - Retry logic: Exponential backoff for transient failures (5xx, network errors)
- Configurable timeouts: Per-request timeout configuration
- Correlation IDs: Automatic UUID generation for request tracing
§API Reference
See: https://chipp.ai/docs/api/reference
§Non-Streaming Example
use chipp::{ChippClient, ChippConfig, ChippSession, ChippMessage};
let config = ChippConfig::builder()
.api_key("YOUR_API_KEY_HERE")
.model("myapp-123")
.build()?;
let client = ChippClient::new(config)?;
let mut session = ChippSession::new();
let response = client.chat(&mut session, &[ChippMessage::user("What is Chipp?")]).await?;
println!("Response: {}", response);§Streaming Example
use chipp::{ChippClient, ChippConfig, ChippSession, ChippMessage};
use futures::StreamExt;
let config = ChippConfig::builder()
.api_key("YOUR_API_KEY_HERE")
.model("myapp-123")
.build()?;
let client = ChippClient::new(config)?;
let mut session = ChippSession::new();
let mut stream = client.chat_stream(&mut session, &[ChippMessage::user("Tell me a story")]).await?;
while let Some(chunk) = stream.next().await {
match chunk {
Ok(text) => print!("{}", text),
Err(e) => eprintln!("Stream error: {}", e),
}
}Structs§
- Chat
Response - Response from a chat completion request.
- Chipp
Client - Chipp API client.
- Chipp
Config - Configuration for Chipp API client.
- Chipp
Config Builder - Builder for
ChippConfig. - Chipp
Message - A message in the conversation.
- Chipp
Session - Session state for maintaining conversation continuity.
- Chipp
Stream - Stream of text chunks from Chipp API.
- Usage
- Token usage information from the API response.
Enums§
- Chipp
Client Error - Errors that can occur when using the Chipp API client.
- Message
Role - Message role in conversation.
Type Aliases§
- Result
- Result type alias for Chipp operations.