gproxy_protocol/openai/realtime/server_events/payloads/
output.rs1use serde::{Deserialize, Serialize};
2
3use crate::openai::common::Rest;
4
5use super::super::super::{RealtimeContentPart, RealtimeItem};
6
7#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
8#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
9pub struct RealtimeResponseOutputItemEvent {
10 pub response_id: String,
11 pub output_index: u32,
12 pub item: RealtimeItem,
13 #[serde(default, flatten)]
14 pub rest: Rest,
15}
16
17#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
18#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
19pub struct RealtimeResponseContentPartEvent {
20 pub response_id: String,
21 pub item_id: String,
22 pub output_index: u32,
23 pub content_index: u32,
24 pub part: RealtimeContentPart,
25 #[serde(default, flatten)]
26 pub rest: Rest,
27}
28
29#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
30#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
31pub struct RealtimeResponseOutputDeltaEvent {
32 pub response_id: String,
33 pub item_id: String,
34 pub output_index: u32,
35 pub content_index: u32,
36 pub delta: String,
37 #[serde(default, flatten)]
38 pub rest: Rest,
39}
40
41#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
42#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
43pub struct RealtimeResponseOutputTextDoneEvent {
44 pub response_id: String,
45 pub item_id: String,
46 pub output_index: u32,
47 pub content_index: u32,
48 pub text: String,
49 #[serde(default, flatten)]
50 pub rest: Rest,
51}
52
53#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
54#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
55pub struct RealtimeResponseAudioTranscriptDoneEvent {
56 pub response_id: String,
57 pub item_id: String,
58 pub output_index: u32,
59 pub content_index: u32,
60 pub transcript: String,
61 #[serde(default, flatten)]
62 pub rest: Rest,
63}
64
65#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
66#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
67pub struct RealtimeResponseOutputAudioDoneEvent {
68 pub response_id: String,
69 pub item_id: String,
70 pub output_index: u32,
71 pub content_index: u32,
72 #[serde(default, flatten)]
73 pub rest: Rest,
74}