1#![cfg_attr(docsrs, feature(doc_cfg))]
2#![deny(missing_docs)]
3#![cfg_attr(
4 test,
5 allow(
6 clippy::expect_used,
7 clippy::indexing_slicing,
8 clippy::panic,
9 clippy::unwrap_used,
10 clippy::unreachable
11 )
12)]
13extern crate self as rig;
22
23#[doc(hidden)]
24pub use rig_core as __core;
25
26pub mod agent;
27pub mod completion;
28pub mod extractor;
29pub mod handlers;
30pub mod integrations;
32pub(crate) use rig_core::json_utils;
33
34pub(crate) fn lock<T>(mutex: &std::sync::Mutex<T>) -> std::sync::MutexGuard<'_, T> {
36 mutex
37 .lock()
38 .unwrap_or_else(std::sync::PoisonError::into_inner)
39}
40pub mod prelude;
41pub mod run;
42pub mod streaming;
43#[cfg(any(test, feature = "test-utils"))]
44#[cfg_attr(docsrs, doc(cfg(feature = "test-utils")))]
45pub mod test_utils;
46pub mod tool;
47
48pub use agent::TypedPromptResponse;
49pub use agent::{
50 Agent, AgentBuilder, AgentHook, AgentRun, AgentRunner, HookContext, ModelHandle, ModelRef,
51 ModelSelection, ModelSelectionAction,
52};
53
54#[cfg(feature = "derive")]
55#[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
56pub use rig_derive::rig_tool;
57
58#[cfg(not(target_family = "wasm"))]
61const _: fn() = || {
62 fn assert_send_sync_static<T: Send + Sync + 'static>() {}
63 assert_send_sync_static::<Agent>();
64 assert_send_sync_static::<AgentRunner>();
65 assert_send_sync_static::<ModelHandle>();
66 assert_send_sync_static::<agent::MultiTurnStreamItem>();
67 assert_send_sync_static::<agent::RunEvents>();
68 assert_send_sync_static::<agent::PromptResponse>();
69 assert_send_sync_static::<tool::server::ToolServerHandle>();
70 assert_send_sync_static::<tool::ToolSet>();
71 assert_send_sync_static::<tool::ToolCatalog>();
72};