1use serde::{Deserialize, Serialize};
6
7#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
8#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
9#[non_exhaustive]
10pub enum ComputerScreenshotContentDetail {
11 #[serde(rename = "low")]
12 Low,
13 #[serde(rename = "high")]
14 High,
15 #[serde(rename = "auto")]
16 Auto,
17 #[serde(rename = "original")]
18 Original,
19}
20
21#[derive(Debug, Clone, Serialize, Deserialize)]
23#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
24pub struct ComputerScreenshotContent {
25 pub detail: ComputerScreenshotContentDetail,
27 #[serde(skip_serializing_if = "Option::is_none", default)]
29 pub file_id: Option<String>,
30 #[serde(skip_serializing_if = "Option::is_none", default)]
32 pub image_url: Option<String>,
33 #[serde(rename = "type")]
35 pub type_: String,
36}
37
38#[derive(Debug, Clone, Serialize, Deserialize)]
39#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
40pub struct Conversation {
41 pub id: String,
43 pub created_at: i64,
45 pub metadata: serde_json::Value,
47 pub object: String,
49}
50
51#[derive(Debug, Clone, Serialize, Deserialize)]
52#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
53pub struct ConversationCreateParams {
54 #[serde(skip_serializing_if = "Option::is_none", default)]
56 pub items: Option<Vec<serde_json::Value>>,
57 #[serde(skip_serializing_if = "Option::is_none", default)]
59 pub metadata: Option<serde_json::Value>,
60}
61
62#[derive(Debug, Clone, Serialize, Deserialize)]
63#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
64pub struct ConversationDeletedResource {
65 pub id: String,
66 pub deleted: bool,
67 pub object: String,
68}
69
70#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
71#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
72#[non_exhaustive]
73pub enum ImageGenerationCallStatus {
74 #[serde(rename = "in_progress")]
75 InProgress,
76 #[serde(rename = "completed")]
77 Completed,
78 #[serde(rename = "generating")]
79 Generating,
80 #[serde(rename = "failed")]
81 Failed,
82}
83
84#[derive(Debug, Clone, Serialize, Deserialize)]
86#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
87pub struct ImageGenerationCall {
88 pub id: String,
90 #[serde(skip_serializing_if = "Option::is_none", default)]
92 pub result: Option<String>,
93 pub status: ImageGenerationCallStatus,
95 #[serde(rename = "type")]
97 pub type_: String,
98}
99
100#[derive(Debug, Clone, Serialize, Deserialize)]
102#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
103pub struct LocalShellCallAction {
104 pub command: Vec<String>,
106 pub env: std::collections::HashMap<String, String>,
108 #[serde(rename = "type")]
110 pub type_: String,
111 #[serde(skip_serializing_if = "Option::is_none", default)]
113 pub timeout_ms: Option<i64>,
114 #[serde(skip_serializing_if = "Option::is_none", default)]
116 pub user: Option<String>,
117 #[serde(skip_serializing_if = "Option::is_none", default)]
119 pub working_directory: Option<String>,
120}
121
122#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
123#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
124#[non_exhaustive]
125pub enum LocalShellCallStatus {
126 #[serde(rename = "in_progress")]
127 InProgress,
128 #[serde(rename = "completed")]
129 Completed,
130 #[serde(rename = "incomplete")]
131 Incomplete,
132}
133
134#[derive(Debug, Clone, Serialize, Deserialize)]
136#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
137pub struct LocalShellCall {
138 pub id: String,
140 pub action: LocalShellCallAction,
142 pub call_id: String,
144 pub status: LocalShellCallStatus,
146 #[serde(rename = "type")]
148 pub type_: String,
149}
150
151#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
152#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
153#[non_exhaustive]
154pub enum LocalShellCallOutputStatus {
155 #[serde(rename = "in_progress")]
156 InProgress,
157 #[serde(rename = "completed")]
158 Completed,
159 #[serde(rename = "incomplete")]
160 Incomplete,
161}
162
163#[derive(Debug, Clone, Serialize, Deserialize)]
165#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
166pub struct LocalShellCallOutput {
167 pub id: String,
169 pub output: String,
171 #[serde(rename = "type")]
173 pub type_: String,
174 #[serde(skip_serializing_if = "Option::is_none", default)]
176 pub status: Option<LocalShellCallOutputStatus>,
177}
178
179#[derive(Debug, Clone, Serialize, Deserialize)]
181#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
182pub struct McpListToolsTool {
183 pub input_schema: serde_json::Value,
185 pub name: String,
187 #[serde(skip_serializing_if = "Option::is_none", default)]
189 pub annotations: Option<serde_json::Value>,
190 #[serde(skip_serializing_if = "Option::is_none", default)]
192 pub description: Option<String>,
193}
194
195#[derive(Debug, Clone, Serialize, Deserialize)]
197#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
198pub struct McpListTools {
199 pub id: String,
201 pub server_label: String,
203 pub tools: Vec<McpListToolsTool>,
205 #[serde(rename = "type")]
207 pub type_: String,
208 #[serde(skip_serializing_if = "Option::is_none", default)]
210 pub error: Option<String>,
211}
212
213#[derive(Debug, Clone, Serialize, Deserialize)]
215#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
216pub struct McpApprovalRequest {
217 pub id: String,
219 pub arguments: String,
221 pub name: String,
223 pub server_label: String,
225 #[serde(rename = "type")]
227 pub type_: String,
228}
229
230#[derive(Debug, Clone, Serialize, Deserialize)]
232#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
233pub struct McpApprovalResponse {
234 pub id: String,
236 pub approval_request_id: String,
238 pub approve: bool,
240 #[serde(rename = "type")]
242 pub type_: String,
243 #[serde(skip_serializing_if = "Option::is_none", default)]
245 pub reason: Option<String>,
246}
247
248#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
249#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
250#[non_exhaustive]
251pub enum McpCallStatus {
252 #[serde(rename = "in_progress")]
253 InProgress,
254 #[serde(rename = "completed")]
255 Completed,
256 #[serde(rename = "incomplete")]
257 Incomplete,
258 #[serde(rename = "calling")]
259 Calling,
260 #[serde(rename = "failed")]
261 Failed,
262}
263
264#[derive(Debug, Clone, Serialize, Deserialize)]
266#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
267pub struct McpCall {
268 pub id: String,
270 pub arguments: String,
272 pub name: String,
274 pub server_label: String,
276 #[serde(rename = "type")]
278 pub type_: String,
279 #[serde(skip_serializing_if = "Option::is_none", default)]
281 pub approval_request_id: Option<String>,
282 #[serde(skip_serializing_if = "Option::is_none", default)]
284 pub error: Option<String>,
285 #[serde(skip_serializing_if = "Option::is_none", default)]
287 pub output: Option<String>,
288 #[serde(skip_serializing_if = "Option::is_none", default)]
290 pub status: Option<McpCallStatus>,
291}
292
293pub type ConversationItem = serde_json::Value;
294
295#[derive(Debug, Clone, Serialize, Deserialize)]
297#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
298pub struct ConversationItemList {
299 pub data: Vec<ConversationItem>,
301 pub first_id: String,
303 pub has_more: bool,
305 pub last_id: String,
307 pub object: String,
309}
310
311#[derive(Debug, Clone, Serialize, Deserialize)]
312#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
313pub struct ConversationUpdateParams {
314 pub metadata: Option<serde_json::Value>,
316}
317
318#[derive(Debug, Clone, Serialize, Deserialize)]
319#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
320pub struct ItemCreateParams {
321 pub items: Vec<serde_json::Value>,
323 #[serde(skip_serializing_if = "Option::is_none", default)]
325 pub include: Option<Vec<serde_json::Value>>,
326}
327
328#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
329#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
330#[non_exhaustive]
331pub enum ItemListParamsOrder {
332 #[serde(rename = "asc")]
333 Asc,
334 #[serde(rename = "desc")]
335 Desc,
336}
337
338#[derive(Debug, Clone, Serialize, Deserialize)]
339#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
340pub struct ItemListParams {
341 #[serde(skip_serializing_if = "Option::is_none", default)]
343 pub after: Option<String>,
344 #[serde(skip_serializing_if = "Option::is_none", default)]
346 pub include: Option<Vec<serde_json::Value>>,
347 #[serde(skip_serializing_if = "Option::is_none", default)]
349 pub limit: Option<i64>,
350 #[serde(skip_serializing_if = "Option::is_none", default)]
352 pub order: Option<ItemListParamsOrder>,
353}
354
355#[derive(Debug, Clone, Serialize, Deserialize)]
356#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
357pub struct ItemRetrieveParams {
358 pub conversation_id: String,
359 #[serde(skip_serializing_if = "Option::is_none", default)]
361 pub include: Option<Vec<serde_json::Value>>,
362}
363
364#[derive(Debug, Clone, Serialize, Deserialize)]
366#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
367pub struct ContentReasoningText {
368 pub text: String,
370 #[serde(rename = "type")]
372 pub type_: String,
373}
374
375pub type Content = serde_json::Value;
376
377#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
378#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
379#[non_exhaustive]
380pub enum MessageRole {
381 #[serde(rename = "unknown")]
382 Unknown,
383 #[serde(rename = "user")]
384 User,
385 #[serde(rename = "assistant")]
386 Assistant,
387 #[serde(rename = "system")]
388 System,
389 #[serde(rename = "critic")]
390 Critic,
391 #[serde(rename = "discriminator")]
392 Discriminator,
393 #[serde(rename = "developer")]
394 Developer,
395 #[serde(rename = "tool")]
396 Tool,
397}
398
399#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
400#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
401#[non_exhaustive]
402pub enum MessageStatus {
403 #[serde(rename = "in_progress")]
404 InProgress,
405 #[serde(rename = "completed")]
406 Completed,
407 #[serde(rename = "incomplete")]
408 Incomplete,
409}
410
411#[derive(Debug, Clone, Serialize, Deserialize)]
413#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
414pub struct Message {
415 pub id: String,
417 pub content: Vec<Content>,
419 pub role: MessageRole,
421 pub status: MessageStatus,
423 #[serde(rename = "type")]
425 pub type_: String,
426}
427
428#[derive(Debug, Clone, Serialize, Deserialize)]
430#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
431pub struct SummaryTextContent {
432 pub text: String,
434 #[serde(rename = "type")]
436 pub type_: String,
437}
438
439#[derive(Debug, Clone, Serialize, Deserialize)]
441#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
442pub struct TextContent {
443 pub text: String,
444 #[serde(rename = "type")]
445 pub type_: String,
446}