core/src/context/realtime_start_with_instructions.rs
37 lines
use super::ContextualUserFragment;use codex_protocol::protocol::REALTIME_CONVERSATION_CLOSE_TAG;use codex_protocol::protocol::REALTIME_CONVERSATION_OPEN_TAG;#[derive(Debug, Clone, PartialEq, Eq)]pub(crate) struct RealtimeStartWithInstructions { instructions: String,}impl RealtimeStartWithInstructions { pub(crate) fn new(instructions: impl Into<String>) -> Self { Self { instructions: instructions.into(), } }}impl ContextualUserFragment for RealtimeStartWithInstructions { fn role(&self) -> &'static str { "developer" } fn markers(&self) -> (&'static str, &'static str) { Self::type_markers() } fn type_markers() -> (&'static str, &'static str) { ( REALTIME_CONVERSATION_OPEN_TAG, REALTIME_CONVERSATION_CLOSE_TAG, ) } fn body(&self) -> String { format!("\n{}\n", self.instructions) }}