mod core;
mod events;
use crate::{Client, Result};
pub use core::*;
pub use events::*;
#[cfg(feature = "realtime")]
#[cfg_attr(docsrs, doc(cfg(feature = "realtime")))]
#[derive(Debug, Clone, Copy, Default)]
pub struct OpenAIRealtimeWebSocket;
#[cfg(feature = "realtime")]
#[cfg_attr(docsrs, doc(cfg(feature = "realtime")))]
pub type OpenAIRealtimeWS = OpenAIRealtimeWebSocket;
#[cfg(feature = "realtime")]
impl OpenAIRealtimeWebSocket {
pub async fn connect(client: Client, model: impl Into<String>) -> Result<RealtimeSocket> {
client.realtime().ws().model(model).connect().await
}
}
#[cfg(feature = "responses-ws")]
#[cfg_attr(docsrs, doc(cfg(feature = "responses-ws")))]
#[derive(Debug, Clone, Copy, Default)]
pub struct OpenAIResponsesWebSocket;
#[cfg(feature = "responses-ws")]
impl OpenAIResponsesWebSocket {
pub async fn connect(client: Client) -> Result<ResponsesSocket> {
client.responses().ws().connect().await
}
}