use crate::{Completion, Prompt};
use async_trait::async_trait;
use origin_domain::{AppError, Result};
use std::fmt::Debug;
#[async_trait]
pub trait AiService: Debug + Send + Sync + 'static {
fn model(&self) -> &str;
async fn complete(&self, prompt: Prompt) -> Result<Completion>;
}
#[derive(Debug, Clone, Copy, Default)]
pub struct NoopAiService;
#[async_trait]
impl AiService for NoopAiService {
fn model(&self) -> &str {
"none"
}
async fn complete(&self, _prompt: Prompt) -> Result<Completion> {
Err(AppError::configuration(
"this application has no AI provider configured",
))
}
}