Skip to main content

gproxy_protocol/openai/generate_content/responses/stream/payloads/
tools.rs

1use serde::{Deserialize, Serialize};
2
3use crate::openai::common::Rest;
4
5#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
6#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
7pub struct ResponseItemStringDeltaEvent {
8    pub delta: String,
9    pub item_id: String,
10    pub output_index: u32,
11    #[serde(skip_serializing_if = "Option::is_none")]
12    pub sequence_number: Option<u64>,
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 ResponseFunctionCallArgumentsDoneEvent {
20    pub arguments: String,
21    // The Codex backend can omit these and relies on output-index state recovery.
22    #[serde(skip_serializing_if = "Option::is_none")]
23    pub item_id: Option<String>,
24    #[serde(skip_serializing_if = "Option::is_none")]
25    pub name: Option<String>,
26    pub output_index: u32,
27    #[serde(skip_serializing_if = "Option::is_none")]
28    pub sequence_number: Option<u64>,
29    #[serde(default, flatten)]
30    pub rest: Rest,
31}
32
33#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
34#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
35pub struct ResponseCustomToolCallInputDoneEvent {
36    pub input: String,
37    pub item_id: String,
38    pub output_index: u32,
39    #[serde(skip_serializing_if = "Option::is_none")]
40    pub sequence_number: Option<u64>,
41    #[serde(default, flatten)]
42    pub rest: Rest,
43}
44
45#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
46#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
47pub struct ResponseToolProgressEvent {
48    pub item_id: String,
49    pub output_index: u32,
50    #[serde(skip_serializing_if = "Option::is_none")]
51    pub sequence_number: Option<u64>,
52    #[serde(default, flatten)]
53    pub rest: Rest,
54}
55
56#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
57#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
58pub struct ResponseImagePartialEvent {
59    pub item_id: String,
60    pub output_index: u32,
61    pub partial_image_b64: String,
62    pub partial_image_index: u32,
63    #[serde(skip_serializing_if = "Option::is_none")]
64    pub sequence_number: Option<u64>,
65    #[serde(default, flatten)]
66    pub rest: Rest,
67}
68
69#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
70#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
71pub struct ResponseCodeInterpreterCallCodeDoneEvent {
72    pub code: String,
73    pub item_id: String,
74    pub output_index: u32,
75    #[serde(skip_serializing_if = "Option::is_none")]
76    pub sequence_number: Option<u64>,
77    #[serde(default, flatten)]
78    pub rest: Rest,
79}
80
81#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
82#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
83pub struct ResponseMcpCallArgumentsDoneEvent {
84    pub arguments: String,
85    pub item_id: String,
86    pub output_index: u32,
87    #[serde(skip_serializing_if = "Option::is_none")]
88    pub sequence_number: Option<u64>,
89    #[serde(default, flatten)]
90    pub rest: Rest,
91}