#![forbid(unsafe_code)]
#![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};
pub use human::{HumanNode, Question, human};
pub use node::{FnNode, Node, NodeError, NodeIo, NodeOutput, node_fn};
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,
}