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 pricing;
11pub mod provider;
12pub mod providers;
13pub mod url_guard;
14pub mod usage;
15
16pub use capability_check::{message_text_for_estimation, RequiredCapabilities};
17pub use context::{CallerTier, RequestContext};
18pub use error::ProviderError;
19pub use messages::{
20    parse_cache_control, CacheControlConfig, CacheMode, ChatCompletionChunk, ChatCompletionRequest,
21    ChatCompletionResponse, Choice, ContentPart, EmbeddingsRequest, EmbeddingsResponse, Message,
22    MessageContent, Tool, ToolCall, ToolChoice,
23};
24pub use pricing::{ModelInfo, ModelPricing};
25pub use provider::Provider;
26pub use url_guard::{
27    filter_extra_headers, find_denied_header, validate_provider_url, UrlGuardError,
28};
29pub use usage::Usage;