Skip to main content

phi_core/agent_loop/
mod.rs

1//! Agent loop — the core execution engine for phi-core agents.
2//!
3//! This module is split into focused sub-modules:
4//! - [`config`] — Hook type aliases and `AgentLoopConfig`
5//! - [`core`] — Entry points: `agent_loop`, `agent_loop_continue`
6//! - [`run`] — Core turn engine (`run_loop`)
7//! - [`streaming`] — LLM response streaming
8//! - [`tools`] — Tool execution pipeline
9//! - [`parallel`] — Evaluational parallelism (`agent_loop_parallel`)
10//! - [`evaluation`] — Pluggable evaluation strategies for parallel branch selection
11//! - [`helpers`] — Utilities (input filters, config derivation, etc.)
12
13mod config;
14mod core;
15pub mod evaluation;
16mod helpers;
17mod parallel;
18mod run;
19pub mod script_callback;
20mod streaming;
21mod tools;
22
23// ── Public re-exports ────────────────────────────────────────────────────────
24
25// Hook types + config struct
26pub use config::*;
27
28// Primary entry points
29pub use core::{agent_loop, agent_loop_continue};
30
31// Parallel evaluation
32pub use parallel::agent_loop_parallel;
33
34// Evaluation strategies
35pub use evaluation::{
36    ElaborateEvaluation, LlmJudgeEvaluation, PickFirstEvaluation, TokenEfficientEvaluation,
37    TransparentEvaluation,
38};
39
40// Internal utility — used by parallel.rs via super::, kept pub(crate) for future BasicAgent use
41#[allow(unused_imports)]
42pub(crate) use helpers::derive_config_segment;