#![cfg_attr(
not(any(feature = "native-http", feature = "wasm-http")),
allow(dead_code, unused_imports)
)]
#![allow(rustdoc::broken_intra_doc_links)]
pub mod auth;
#[cfg(any(feature = "native-http", feature = "wasm-http"))]
pub mod bindings;
#[cfg(feature = "tower")]
pub mod cache_key;
pub mod client;
pub mod cost;
#[cfg(feature = "tower")]
pub mod embedding;
pub mod error;
pub mod guardrail;
pub(crate) mod http;
pub mod image;
pub mod observability;
pub mod provider;
pub mod realtime;
pub mod streaming;
pub mod tenant;
#[cfg(test)]
mod tests;
#[cfg(feature = "tokenizer")]
pub mod tokenizer;
#[cfg(feature = "tower")]
pub mod tower;
pub mod types;
pub mod util;
#[cfg(feature = "tower")]
pub mod vectorstore;
pub use client::{
BatchClient, BedrockConfig, BoxFuture, BoxStream, ClientBuilder, ClientConfig, ClientConfigBuilder, FileClient,
FileConfig, LlmBudgetConfig, LlmCacheConfig, LlmClient, LlmClientRaw, LlmConfig, LlmInFlightLimitConfig,
LlmProviderConfig, LlmRateLimitConfig, ResponseClient,
};
#[cfg(any(feature = "native-http", feature = "wasm-http"))]
pub use client::{BatchWaitError, WaitForBatchConfig};
pub use http::transport::TransportConfig;
#[cfg(any(feature = "native-http", feature = "wasm-http"))]
pub use client::DefaultClient;
#[cfg(any(feature = "native-http", feature = "wasm-http"))]
pub use bindings::{create_client, create_client_from_json};
#[cfg(all(feature = "native-http", feature = "tower"))]
pub use client::managed::ManagedClient;
pub use error::{LiterLlmError, Result};
#[cfg(feature = "tower")]
pub use tower::{BudgetConfig, CacheBackend, CacheConfig, Enforcement, InFlightLimitConfig, RateLimitConfig};
#[cfg(feature = "tower")]
pub use tower::{
CacheKeyStrategy, EmbeddingProvider, ExactHashStrategy, Guardrail, GuardrailContext, GuardrailDecision,
GuardrailStage, NoOpEmbeddingProvider, SystemPromptAwareStrategy, TenantScopedStrategy, VectorMatch, VectorStore,
};
pub use cost::{ModelInfo, ModelTier, completion_cost, completion_cost_with_cache, model_info};
pub use cost::refresh::{
CatalogRefreshConfig, CatalogRefreshError, DEFAULT_CATALOG_URL, RefreshOutcome, clear_catalog_overlay,
install_catalog_overlay_from_str, refresh_catalog,
};
pub use provider::custom::{
AuthHeaderFormat, CustomProviderConfig, register_custom_provider, unregister_custom_provider,
};
pub use provider::{
AuthConfig, AuthType, ProviderCapabilities, ProviderConfig, StreamFormat, all_providers, capabilities,
complex_provider_names,
};
#[cfg(feature = "tokenizer")]
pub use tokenizer::{count_request_tokens, count_tokens};
pub use types::*;
pub use realtime::{OpenAiRealtimeTranslator, RealtimeEnvelope, RealtimeEvent, RealtimeTranslator, ResponseStatus};
pub use tenant::{InMemoryKeyResolver, KeyResolver, KeyResolverError, ResolvedKey, TenantContext, TenantId};
#[cfg(all(feature = "native-http", not(target_os = "windows")))]
pub fn ensure_crypto_provider() {
use std::sync::Once;
static INIT: Once = Once::new();
INIT.call_once(|| {
let _ = rustls::crypto::ring::default_provider().install_default();
});
}
#[cfg(all(feature = "native-http", target_os = "windows"))]
pub fn ensure_crypto_provider() {}