use std::sync::Arc;
use crate::{OpenAiAuth, ReasoningMode, ResponsesHistory, ResponsesTransport, Thinking};
const SYSTEM_PROMPT: &str = include_str!("../../prompts/system.md");
#[derive(Clone)]
pub struct ModelConfig {
pub auth: OpenAiAuth,
pub reasoning_mode: ReasoningMode,
pub thinking: Thinking,
pub fast_mode: bool,
pub responses_transport: ResponsesTransport,
pub responses_history: ResponsesHistory,
pub store_responses: bool,
pub websocket_url: String,
pub api_base_url: String,
#[cfg(any(target_family = "wasm", docsrs))]
pub host_transport: Option<Arc<dyn crate::transport::host::HostTransport>>,
pub system_prompt: Arc<str>,
}
impl ModelConfig {
#[must_use]
pub const fn orchestration() -> &'static str {
"local_code_mode"
}
#[must_use]
pub fn system_prompt(&self) -> &str {
&self.system_prompt
}
#[must_use]
pub fn search_endpoint(&self) -> String {
format!("{}/alpha/search", self.api_base_url.trim_end_matches('/'))
}
}
impl Default for ModelConfig {
fn default() -> Self {
Self {
auth: OpenAiAuth::api_key(String::new()),
reasoning_mode: ReasoningMode::default(),
thinking: Thinking::default(),
fast_mode: false,
responses_transport: ResponsesTransport::default(),
responses_history: ResponsesHistory::default(),
store_responses: false,
websocket_url: "wss://api.openai.com/v1/responses".to_owned(),
api_base_url: "https://api.openai.com/v1".to_owned(),
#[cfg(any(target_family = "wasm", docsrs))]
host_transport: None,
system_prompt: SYSTEM_PROMPT.into(),
}
}
}