1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! Multi-agent orchestration support.
//!
//! This module provides tools for coordinating multiple AI agents,
//! routing requests based on intent, and managing multi-step workflows.
//!
//! # Overview
//!
//! The orchestration module includes:
//! - **Intent routing**: Classify user intents and route to appropriate agents
//! - **Session management**: Maintain state across interactions
//! - **Workflow execution**: Run multi-step workflows with dependencies
//! - **Agent coordination**: Orchestrate multiple agents with different strategies
//!
//! # Example
//!
//! ```no_run
//! use liteforge::orchestration::{
//! AgentOrchestrator, OrchestratorConfig, OrchestrationStrategy,
//! IntentRouter, IntentRoute, CommonIntents,
//! };
//! use std::sync::Arc;
//!
//! # async fn example() {
//! // Create orchestrator with intent-based routing
//! let config = OrchestratorConfig::new()
//! .strategy(OrchestrationStrategy::IntentBased)
//! .default_agent("general");
//!
//! let orchestrator = AgentOrchestrator::new(config);
//!
//! // Register agents with routes
//! // orchestrator.register_agent_with_route(agent, route).await;
//!
//! // Process messages
//! // let result = orchestrator.process("session-123", "Hello!").await;
//! # }
//! ```
//!
//! # Workflow Example
//!
//! ```rust
//! use liteforge::orchestration::{
//! Workflow, WorkflowStep, WorkflowExecutor, EchoExecutor,
//! };
//! use std::sync::Arc;
//!
//! # async fn example() {
//! // Define a workflow
//! let workflow = Workflow::new("analysis", "Data Analysis")
//! .step(WorkflowStep::new("fetch", "Fetch Data", "data_agent"))
//! .step(WorkflowStep::new("analyze", "Analyze", "analysis_agent")
//! .depends_on("fetch"))
//! .step(WorkflowStep::new("report", "Generate Report", "report_agent")
//! .depends_on("analyze"));
//!
//! // Create executor with agents
//! let executor = WorkflowExecutor::new()
//! .register(Arc::new(EchoExecutor::new("data_agent")))
//! .register(Arc::new(EchoExecutor::new("analysis_agent")))
//! .register(Arc::new(EchoExecutor::new("report_agent")));
//!
//! // Execute workflow
//! let result = executor.execute(&workflow).await;
//! # }
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;