use serde::{Deserialize, Serialize};
use crate::{SkillScheduler, WorkflowCallback, WorkflowExecutor, WorkflowMode};
use std::sync::Arc;
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct IntentAnalysisResult {
pub categories: Vec<String>,
pub clean_intent: String,
}
#[derive(Debug, Clone)]
pub struct WorkflowExecResult {
pub json_output: String,
pub original_input: String,
}
#[derive(Debug, Clone)]
pub struct FormatResult {
pub final_output: String,
pub was_converted: bool,
}
#[async_trait::async_trait]
pub trait Pipeline: Send + Sync {
async fn intent_analysis(
&self,
scheduler: &SkillScheduler,
input: &str,
) -> anyhow::Result<IntentAnalysisResult>;
async fn workflow_execution(
&self,
mode: WorkflowMode,
executor: &WorkflowExecutor,
scheduler: &SkillScheduler,
input: &str,
callback: Option<Arc<dyn WorkflowCallback>>,
) -> WorkflowExecResult;
async fn response_formatting(
&self,
scheduler: &SkillScheduler,
original_input: &str,
json_output: &str,
) -> FormatResult;
}