Skip to main content

tt_shared/
lib.rs

1//! Shared types, errors, and traits for the TokenTrimmer workspace.
2//!
3//! No business logic lives here — only the contracts that other crates implement.
4//! See `docs/02-provider-adapter-guide.md` for the Provider trait.
5
6pub mod capability_check;
7pub mod context;
8pub mod error;
9pub mod messages;
10pub mod model_catalog;
11pub mod pricing;
12pub mod provider;
13pub mod providers;
14pub mod url_guard;
15pub mod usage;
16
17pub use capability_check::{message_text_for_estimation, RequiredCapabilities};
18pub use context::{CallerTier, RequestContext};
19pub use error::ProviderError;
20pub use messages::{
21    parse_cache_control, CacheControlConfig, CacheMode, ChatCompletionChunk, ChatCompletionRequest,
22    ChatCompletionResponse, Choice, ContentPart, EmbeddingsRequest, EmbeddingsResponse, Message,
23    MessageContent, Tool, ToolCall, ToolChoice,
24};
25pub use model_catalog::{model_catalog, ModelCatalog};
26pub use pricing::{ModelInfo, ModelPricing};
27pub use provider::Provider;
28pub use url_guard::{
29    filter_extra_headers, find_denied_header, validate_provider_url, UrlGuardError,
30};
31pub use usage::Usage;