Skip to main content

semantic_operators/
lib.rs

1//! Typed semantic questions, confidence-aware answers, and provider-neutral composition.
2//!
3//! Default features require no network or particular async runtime. Enable
4//! `typesafe`, `images`, `tokio`, or `blocking` for optional integrations.
5
6#![doc = include_str!("../CRATE.md")]
7#![cfg_attr(docsrs, feature(doc_cfg))]
8#![warn(
9    clippy::missing_errors_doc,
10    clippy::missing_panics_doc,
11    clippy::dbg_macro,
12    clippy::print_stdout,
13    clippy::print_stderr
14)]
15
16pub mod answer;
17pub mod bench;
18#[cfg(feature = "blocking")]
19#[cfg_attr(docsrs, doc(cfg(feature = "blocking")))]
20pub mod blocking;
21pub mod cascade;
22pub mod each;
23pub mod error;
24pub mod filter;
25pub mod flow;
26#[cfg(feature = "images")]
27#[cfg_attr(docsrs, doc(cfg(feature = "images")))]
28pub mod image;
29#[cfg(feature = "images")]
30#[cfg_attr(docsrs, doc(cfg(feature = "images")))]
31pub mod locate;
32pub mod operator;
33pub mod provider;
34#[cfg(feature = "typesafe")]
35#[cfg_attr(docsrs, doc(cfg(feature = "typesafe")))]
36pub mod providers;
37pub mod question;
38pub mod rerank;
39pub mod state;
40pub mod wire;
41
42pub use answer::{
43    Answer, AnswerType, AnswerValue, Call, Probabilities, complement, make_answer, token_count,
44};
45pub use cascade::Cascade;
46#[cfg(feature = "tokio")]
47#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
48pub use cascade::TimeLimited;
49pub use error::{Error, ErrorKind};
50pub use indexmap::IndexMap;
51pub use operator::{NamedQuestion, Operator, apply};
52pub use provider::{Answers, FunctionProvider, Provider, ProviderFuture, Questions, Request, ask};
53pub use question::{Boolean, BoxQuestion, Choice, Question, Region, Score, TypedQuestion};
54pub use state::State;
55
56/// A library result. Uncertainty is represented inside a successful answer.
57pub type Result<T, E = Error> = std::result::Result<T, E>;