1use serde::{Deserialize, Serialize};
2
3use super::super::{DocumentBlock, JsonObject, StopReason, ToolReferenceBlock};
4
5#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
6#[non_exhaustive]
7pub struct WebFetchResultBlock {
8 pub content: DocumentBlock,
9 #[serde(rename = "type")]
10 pub type_: WebFetchResultBlockType,
11 pub url: String,
12 #[serde(skip_serializing_if = "Option::is_none")]
13 pub retrieved_at: Option<String>,
14 #[serde(default, flatten, skip_serializing_if = "JsonObject::is_empty")]
15 pub extra: JsonObject,
16}
17
18#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
19#[non_exhaustive]
20pub enum WebFetchResultBlockType {
21 #[serde(rename = "web_fetch_result")]
22 WebFetchResult,
23}
24
25#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
26#[non_exhaustive]
27pub struct AdvisorResultBlock {
28 pub text: String,
29 #[serde(rename = "type")]
30 pub type_: AdvisorResultBlockType,
31 #[serde(skip_serializing_if = "Option::is_none")]
32 pub stop_reason: Option<StopReason>,
33 #[serde(default, flatten, skip_serializing_if = "JsonObject::is_empty")]
34 pub extra: JsonObject,
35}
36
37#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
38#[non_exhaustive]
39pub enum AdvisorResultBlockType {
40 #[serde(rename = "advisor_result")]
41 AdvisorResult,
42}
43
44#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
45#[non_exhaustive]
46pub struct AdvisorRedactedResultBlock {
47 pub encrypted_content: String,
48 #[serde(rename = "type")]
49 pub type_: AdvisorRedactedResultBlockType,
50 #[serde(skip_serializing_if = "Option::is_none")]
51 pub stop_reason: Option<StopReason>,
52 #[serde(default, flatten, skip_serializing_if = "JsonObject::is_empty")]
53 pub extra: JsonObject,
54}
55
56#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
57#[non_exhaustive]
58pub enum AdvisorRedactedResultBlockType {
59 #[serde(rename = "advisor_redacted_result")]
60 AdvisorRedactedResult,
61}
62
63#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
64#[non_exhaustive]
65pub struct CodeExecutionOutputBlock {
66 pub file_id: String,
67 #[serde(rename = "type")]
68 pub type_: CodeExecutionOutputBlockType,
69 #[serde(default, flatten, skip_serializing_if = "JsonObject::is_empty")]
70 pub extra: JsonObject,
71}
72
73#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
74#[non_exhaustive]
75pub enum CodeExecutionOutputBlockType {
76 #[serde(rename = "code_execution_output")]
77 CodeExecutionOutput,
78}
79
80#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
81#[non_exhaustive]
82pub struct CodeExecutionResultBlock {
83 pub content: Vec<CodeExecutionOutputBlock>,
84 pub return_code: i64,
85 pub stderr: String,
86 pub stdout: String,
87 #[serde(rename = "type")]
88 pub type_: CodeExecutionResultBlockType,
89 #[serde(default, flatten, skip_serializing_if = "JsonObject::is_empty")]
90 pub extra: JsonObject,
91}
92
93#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
94#[non_exhaustive]
95pub enum CodeExecutionResultBlockType {
96 #[serde(rename = "code_execution_result")]
97 CodeExecutionResult,
98}
99
100#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
101#[non_exhaustive]
102pub struct EncryptedCodeExecutionResultBlock {
103 pub content: Vec<CodeExecutionOutputBlock>,
104 pub encrypted_stdout: String,
105 pub return_code: i64,
106 pub stderr: String,
107 #[serde(rename = "type")]
108 pub type_: EncryptedCodeExecutionResultBlockType,
109 #[serde(default, flatten, skip_serializing_if = "JsonObject::is_empty")]
110 pub extra: JsonObject,
111}
112
113#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
114#[non_exhaustive]
115pub enum EncryptedCodeExecutionResultBlockType {
116 #[serde(rename = "encrypted_code_execution_result")]
117 EncryptedCodeExecutionResult,
118}
119
120#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
121#[non_exhaustive]
122pub struct BashCodeExecutionOutputBlock {
123 pub file_id: String,
124 #[serde(rename = "type")]
125 pub type_: BashCodeExecutionOutputBlockType,
126 #[serde(default, flatten, skip_serializing_if = "JsonObject::is_empty")]
127 pub extra: JsonObject,
128}
129
130#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
131#[non_exhaustive]
132pub enum BashCodeExecutionOutputBlockType {
133 #[serde(rename = "bash_code_execution_output")]
134 BashCodeExecutionOutput,
135}
136
137#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
138#[non_exhaustive]
139pub struct BashCodeExecutionResultBlock {
140 pub content: Vec<BashCodeExecutionOutputBlock>,
141 pub return_code: i64,
142 pub stderr: String,
143 pub stdout: String,
144 #[serde(rename = "type")]
145 pub type_: BashCodeExecutionResultBlockType,
146 #[serde(default, flatten, skip_serializing_if = "JsonObject::is_empty")]
147 pub extra: JsonObject,
148}
149
150#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
151#[non_exhaustive]
152pub enum BashCodeExecutionResultBlockType {
153 #[serde(rename = "bash_code_execution_result")]
154 BashCodeExecutionResult,
155}
156
157#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
158#[non_exhaustive]
159pub struct ToolSearchToolSearchResultBlock {
160 pub tool_references: Vec<ToolReferenceBlock>,
161 #[serde(rename = "type")]
162 pub type_: ToolSearchToolSearchResultBlockType,
163 #[serde(default, flatten, skip_serializing_if = "JsonObject::is_empty")]
164 pub extra: JsonObject,
165}
166
167#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
168#[non_exhaustive]
169pub enum ToolSearchToolSearchResultBlockType {
170 #[serde(rename = "tool_search_tool_search_result")]
171 ToolSearchToolSearchResult,
172}