use crate::protocol::google::GoogleProtocol;
use crate::protocol::LLMProtocol;
use crate::stream::AssistantMessageEventStream;
use crate::types::*;
use async_trait::async_trait;
pub struct GoogleProvider {
inner: GoogleProtocol,
}
impl GoogleProvider {
pub fn new() -> Self {
Self {
inner: GoogleProtocol::new(),
}
}
pub fn with_api_key(api_key: impl Into<String>) -> Self {
Self {
inner: GoogleProtocol::with_api_key(api_key),
}
}
}
impl Default for GoogleProvider {
fn default() -> Self {
Self::new()
}
}
#[async_trait]
impl LLMProtocol for GoogleProvider {
fn provider_type(&self) -> Provider {
Provider::Google
}
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)
}
}