openai_agents_rust/model/
openai_realtime.rs1use crate::config::Config;
2use crate::error::AgentError;
3use crate::model::Model;
4use async_trait::async_trait;
5use reqwest::Client;
6
7pub struct OpenAiRealtime {
9 _client: Client,
10 _config: Config,
11}
12
13impl OpenAiRealtime {
14 pub fn new(config: Config) -> Self {
15 let client = Client::builder()
16 .user_agent("openai-agents-rust")
17 .build()
18 .expect("Failed to build reqwest client");
19 Self {
20 _client: client,
21 _config: config,
22 }
23 }
24}
25
26#[async_trait]
27impl Model for OpenAiRealtime {
28 async fn generate(&self, prompt: &str) -> Result<String, AgentError> {
29 Ok(format!("Realtime response to: {}", prompt))
32 }
33}