use crate::protocol::openai_responses::OpenAIResponsesProtocol;
use crate::protocol::LLMProtocol;
use crate::stream::AssistantMessageEventStream;
use crate::types::*;
use async_trait::async_trait;
pub struct OpenAIResponsesProvider {
inner: OpenAIResponsesProtocol,
}
impl OpenAIResponsesProvider {
pub fn new() -> Self {
Self {
inner: OpenAIResponsesProtocol::new(),
}
}
pub fn with_api_key(api_key: impl Into<String>) -> Self {
Self {
inner: OpenAIResponsesProtocol::with_api_key(api_key),
}
}
}
impl Default for OpenAIResponsesProvider {
fn default() -> Self {
Self::new()
}
}
#[async_trait]
impl LLMProtocol for OpenAIResponsesProvider {
fn provider_type(&self) -> Provider {
Provider::OpenAIResponses
}
fn stream(
&self,
model: &Model,
context: &Context,
options: StreamOptions,
) -> AssistantMessageEventStream {
self.inner.stream(model, context, options)
}
fn stream_simple(
&self,
model: &Model,
context: &Context,
options: SimpleStreamOptions,
) -> AssistantMessageEventStream {
self.inner.stream_simple(model, context, options)
}
}