#![forbid(unsafe_code)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(
test,
allow(
clippy::expect_used,
clippy::panic,
clippy::unwrap_used,
clippy::unreachable
)
)]
mod checkpoint;
mod events;
mod graph;
mod human;
mod node;
mod swarm;
pub use checkpoint::CheckpointError;
pub use graph::{
Graph, GraphBuilder, GraphError, GraphEvent, GraphFailure, GraphRun, GraphState, RunState,
};
pub use human::{HumanNode, Question, human};
pub use node::{
FnNode, Node, NodeError, NodeIo, NodeOutput, StateFnNode, node_fn, node_fn_with_state,
};
pub use rig_memory;
pub use swarm::{
ASK_TOOL, HANDOFF_TOOL, Handoff, Swarm, SwarmBuilder, SwarmError, SwarmEvent, SwarmFailure,
SwarmRun,
};
#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
#[non_exhaustive]
pub enum BuildError {
#[error("a swarm or graph needs at least one member")]
Empty,
#[error("every swarm agent needs a name (AgentBuilder::name)")]
UnnamedAgent,
#[error("two members are named {0:?}")]
DuplicateName(String),
#[error("no member is named {0:?}")]
UnknownName(String),
#[error("every node has an incoming edge; name where the graph starts with entry()")]
NoEntry,
#[error("the graph has a cycle; bound it with max_node_executions()")]
UnboundedCycle,
#[error("max_turns_per_agent must be at least 1")]
ZeroTurns,
}
#[cfg(doctest)]
#[doc = include_str!("../README.md")]
mod readme_doctests {}