use std::{future::Future, pin::Pin};
use crate::{
error::Result,
generic::GenericChatCompletionResponse,
template::{IntoPrompt, PromptTemplate},
};
pub trait PromptExecutionProvider: Send + Sync {
type Message: Send + Sync + 'static;
fn prompt_execute<'a, 'p, P>(&'a self, prompt: P) -> BoxedResponseFut<'p, P::Output>
where
'a: 'p,
P: PromptTemplate + Send + Sync + 'p,
<P as IntoPrompt>::Message: Into<Self::Message>;
}
pub type BoxedResponseFut<'p, Output> =
Pin<Box<dyn Future<Output = Result<GenericChatCompletionResponse<Output>>> + Send + 'p>>;