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 batch_advisor;
7pub mod capability_check;
8pub mod context;
9pub mod error;
10pub mod messages;
11pub mod model_catalog;
12pub mod pricing;
13pub mod provider;
14pub mod providers;
15pub mod url_guard;
16pub mod usage;
17
18pub use batch_advisor::{
19    project_batch_savings, project_batch_savings_with_tags, BatchFinding, RequestAggregate,
20    DEFAULT_BATCH_ELIGIBLE_TAGS,
21};
22pub use capability_check::{message_text_for_estimation, RequiredCapabilities};
23pub use context::{CallerTier, RequestContext};
24pub use error::ProviderError;
25pub use messages::{
26    parse_cache_control, CacheControlConfig, CacheMode, ChatCompletionChunk, ChatCompletionRequest,
27    ChatCompletionResponse, Choice, ContentPart, EmbeddingsRequest, EmbeddingsResponse, Message,
28    MessageContent, Tool, ToolCall, ToolChoice,
29};
30pub use model_catalog::{model_catalog, ModelCatalog};
31pub use pricing::{CacheWriteTier, ModelInfo, ModelPricing};
32pub use provider::Provider;
33pub use url_guard::{
34    filter_extra_headers, find_denied_header, validate_provider_url, UrlGuardError,
35};
36pub use usage::Usage;