rig-core 0.42.0

An opinionated library for building LLM powered applications.
Documentation
//! Doubleword inference API client and Rig integration.
//!
//! [Doubleword](https://docs.doubleword.ai) is an OpenAI-compatible inference
//! provider. This integration covers the **realtime** tier: synchronous chat
//! completions and streaming via [`CompletionModel`], plus embeddings
//! ([`EmbeddingModel`]) on the same endpoint. Doubleword's two cheaper tiers
//! are separate mechanisms and Rig models neither: the **async** tier is the
//! same endpoints with `service_tier: "flex"` (plus `background: true` to
//! poll), while only the **batch** tier uses the OpenAI-compatible Batch API
//! (`/v1/batches`) with a JSONL upload.
//!
//! Set `DOUBLEWORD_API_KEY` (and optionally `DOUBLEWORD_BASE_URL`) to use
//! [`ProviderClient::from_env`](crate::client::ProviderClient::from_env).
//!
//! # Example
//! ```no_run
//! use rig_core::{
//!     client::{CompletionClient, ProviderClient},
//!     completion::CompletionModel,
//!     providers::doubleword,
//! };
//!
//! # async fn run() -> Result<(), Box<dyn std::error::Error>> {
//! let client = doubleword::Client::from_env()?;
//! let model = client.completion_model(doubleword::QWEN3_5_9B);
//! let request = model.completion_request("What is Rig?").build();
//! let response = model.completion(request).await?;
//! # let _ = response;
//! # Ok(())
//! # }
//! ```

pub mod client;
pub mod completion;
pub mod embedding;

pub use client::Client;
pub use completion::*;
pub use embedding::*;