#![forbid(unsafe_code)]
pub mod embed;
pub mod error;
pub mod external;
pub mod fts;
pub mod provider;
pub mod rank;
pub mod vec;
pub use embed::{
DEFAULT_DOC_TOKEN_BUDGET, DOC_HEADER_MARGIN_TOKENS, DocEmbedBlockRef, DocEmbedMethod,
DocEmbedTask, EMBED_BATCH, EmbedTask, MIN_EMBED_TOKENS, context_prefix, ctx_hash, doc_header,
doc_input, embed_input, estimate_tokens, hex, pool_block_vectors, sha256, should_embed,
token_budget, word_count,
};
pub use error::{Error, Result};
#[cfg(feature = "http")]
pub use external::HttpProvider;
pub use external::{
EmbeddingSettings, StdioProvider, create_external_provider, embedder_env, is_url,
};
pub use fts::{has_word_char, is_js_whitespace, sanitize_fts_query, split_ws};
pub use provider::{
EmbeddingProvider, FIXTURE_DIM, FIXTURE_MAX_INPUT_TOKENS, FIXTURE_MODEL, FixtureEmbedder,
};
pub use rank::{
BoostFacts, Boosts, Candidate, Evidence, HYBRID_PASS_LIMIT, PREVIEW_WORDS,
RESOLVE_DEFAULT_LIMIT, RRF_K, apply_boosts, compute_boosts, default_terms, fuse, layer_boost,
locator, lower_terms, preview, property_to_string, rrf_score, sort_by_score,
};
pub use vec::{blob_to_f32, cosine_bytes, cosine_f32, f32_to_blob, to_f32};
pub const SPEC_VERSION: &str = "1.2";
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
#[cfg(test)]
mod tests {
#[test]
fn crate_version_tracks_the_spec() {
assert!(env!("CARGO_PKG_VERSION").starts_with(&format!("{}.", super::SPEC_VERSION)));
}
}