Skip to main content

matrixcode_core/tools/workflow/
mod.rs

1//! Workflow Tools
2//!
3//! 工作流相关工具集合
4
5mod content;
6mod create;
7mod discover;
8mod r#match;
9mod run;
10
11pub use content::ContentGenerationTool;
12pub use create::WorkflowCreateTool;
13pub use discover::WorkflowDiscoverTool;
14pub use r#match::WorkflowMatchTool;
15pub use run::WorkflowRunTool;
16
17use crate::providers::Provider;
18use crate::tools::BoxedTool;
19use std::sync::Arc;
20
21/// Get all workflow management tools
22pub fn workflow_tools() -> Vec<BoxedTool> {
23    vec![
24        Box::new(WorkflowDiscoverTool),
25        Box::new(WorkflowRunTool::new()),
26        Box::new(WorkflowMatchTool),
27        Box::new(WorkflowCreateTool),
28    ]
29}
30
31/// Get workflow tools that need provider
32pub fn workflow_tools_with_provider(provider: Arc<dyn Provider>) -> Vec<BoxedTool> {
33    vec![
34        Box::new(WorkflowRunTool::with_provider(provider.clone())),
35        Box::new(ContentGenerationTool::new(provider)),
36    ]
37}