Skip to main content

matrixcode_core/tools/workflow/
mod.rs

1//! Workflow Tools
2//!
3//! 工作流相关工具集合
4
5mod discover;
6mod run;
7mod r#match;
8mod content;
9mod create;
10
11pub use discover::WorkflowDiscoverTool;
12pub use run::WorkflowRunTool;
13pub use r#match::WorkflowMatchTool;
14pub use content::ContentGenerationTool;
15pub use create::WorkflowCreateTool;
16
17use crate::tools::BoxedTool;
18use std::sync::Arc;
19use crate::providers::Provider;
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}