Download codex-rs/protocol/src/realtime.rs from SaylorTwift/codex: direct link, hf CLI and curl.
- Browser
- Download file 1.77 kB
-
https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/protocol/src/realtime.rs
- Command line
-
hf download hf://SaylorTwift/codex/codex-rs/protocol/src/realtime.rs
-
curl -L -o realtime.rs https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/protocol/src/realtime.rs
1.77 kB
| use schemars::JsonSchema; | |
| use serde::Deserialize; | |
| use serde::Serialize; | |
| use ts_rs::TS; | |
| /// A realtime thread item persisted in the canonical rollout. | |
| pub struct RealtimeItem { | |
| pub id: String, | |
| pub realtime_session_id: String, | |
| pub content: RealtimeItemContent, | |
| } | |
| /// The minimum facts needed to interleave realtime speech and agent work. | |
| pub enum RealtimeItemContent { | |
| RealtimeSessionStarted, | |
| TranscriptSegment { | |
| role: RealtimeTranscriptRole, | |
| text: String, | |
| }, | |
| BemItemPromoted { | |
| turn_id: String, | |
| item_id: String, | |
| presentation: BemItemPresentation, | |
| }, | |
| RealtimeSessionClosed { | |
| outcome: RealtimeSessionOutcome, | |
| }, | |
| } | |
| pub enum RealtimeSessionOutcome { | |
| Ended, | |
| Failed, | |
| } | |
| pub enum RealtimeTranscriptRole { | |
| User, | |
| Assistant, | |
| } | |
| /// How an existing agent item is presented in the realtime conversation. | |
| pub enum BemItemPresentation { | |
| WholeItem, | |
| InlineMarkdown, | |
| InlineVisualization { index: u32 }, | |
| } | |