use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
#[non_exhaustive]
pub enum ComputerScreenshotContentDetail {
#[serde(rename = "low")]
Low,
#[serde(rename = "high")]
High,
#[serde(rename = "auto")]
Auto,
#[serde(rename = "original")]
Original,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct ComputerScreenshotContent {
pub detail: ComputerScreenshotContentDetail,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub file_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub image_url: Option<String>,
#[serde(rename = "type")]
pub type_: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct Conversation {
pub id: String,
pub created_at: i64,
pub metadata: serde_json::Value,
pub object: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct ConversationCreateParams {
#[serde(skip_serializing_if = "Option::is_none", default)]
pub items: Option<Vec<serde_json::Value>>,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub metadata: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct ConversationDeletedResource {
pub id: String,
pub deleted: bool,
pub object: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
#[non_exhaustive]
pub enum ImageGenerationCallStatus {
#[serde(rename = "in_progress")]
InProgress,
#[serde(rename = "completed")]
Completed,
#[serde(rename = "generating")]
Generating,
#[serde(rename = "failed")]
Failed,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct ImageGenerationCall {
pub id: String,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub result: Option<String>,
pub status: ImageGenerationCallStatus,
#[serde(rename = "type")]
pub type_: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct LocalShellCallAction {
pub command: Vec<String>,
pub env: std::collections::HashMap<String, String>,
#[serde(rename = "type")]
pub type_: String,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub timeout_ms: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub user: Option<String>,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub working_directory: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
#[non_exhaustive]
pub enum LocalShellCallStatus {
#[serde(rename = "in_progress")]
InProgress,
#[serde(rename = "completed")]
Completed,
#[serde(rename = "incomplete")]
Incomplete,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct LocalShellCall {
pub id: String,
pub action: LocalShellCallAction,
pub call_id: String,
pub status: LocalShellCallStatus,
#[serde(rename = "type")]
pub type_: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
#[non_exhaustive]
pub enum LocalShellCallOutputStatus {
#[serde(rename = "in_progress")]
InProgress,
#[serde(rename = "completed")]
Completed,
#[serde(rename = "incomplete")]
Incomplete,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct LocalShellCallOutput {
pub id: String,
pub output: String,
#[serde(rename = "type")]
pub type_: String,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub status: Option<LocalShellCallOutputStatus>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct McpListToolsTool {
pub input_schema: serde_json::Value,
pub name: String,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub annotations: Option<serde_json::Value>,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub description: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct McpListTools {
pub id: String,
pub server_label: String,
pub tools: Vec<McpListToolsTool>,
#[serde(rename = "type")]
pub type_: String,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub error: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct McpApprovalRequest {
pub id: String,
pub arguments: String,
pub name: String,
pub server_label: String,
#[serde(rename = "type")]
pub type_: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct McpApprovalResponse {
pub id: String,
pub approval_request_id: String,
pub approve: bool,
#[serde(rename = "type")]
pub type_: String,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub reason: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
#[non_exhaustive]
pub enum McpCallStatus {
#[serde(rename = "in_progress")]
InProgress,
#[serde(rename = "completed")]
Completed,
#[serde(rename = "incomplete")]
Incomplete,
#[serde(rename = "calling")]
Calling,
#[serde(rename = "failed")]
Failed,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct McpCall {
pub id: String,
pub arguments: String,
pub name: String,
pub server_label: String,
#[serde(rename = "type")]
pub type_: String,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub approval_request_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub error: Option<String>,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub output: Option<String>,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub status: Option<McpCallStatus>,
}
pub type ConversationItem = serde_json::Value;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct ConversationItemList {
pub data: Vec<ConversationItem>,
pub first_id: String,
pub has_more: bool,
pub last_id: String,
pub object: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct ConversationUpdateParams {
pub metadata: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct ItemCreateParams {
pub items: Vec<serde_json::Value>,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub include: Option<Vec<serde_json::Value>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
#[non_exhaustive]
pub enum ItemListParamsOrder {
#[serde(rename = "asc")]
Asc,
#[serde(rename = "desc")]
Desc,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct ItemListParams {
#[serde(skip_serializing_if = "Option::is_none", default)]
pub after: Option<String>,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub include: Option<Vec<serde_json::Value>>,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub limit: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub order: Option<ItemListParamsOrder>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct ItemRetrieveParams {
pub conversation_id: String,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub include: Option<Vec<serde_json::Value>>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct ContentReasoningText {
pub text: String,
#[serde(rename = "type")]
pub type_: String,
}
pub type Content = serde_json::Value;
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
#[non_exhaustive]
pub enum MessageRole {
#[serde(rename = "unknown")]
Unknown,
#[serde(rename = "user")]
User,
#[serde(rename = "assistant")]
Assistant,
#[serde(rename = "system")]
System,
#[serde(rename = "critic")]
Critic,
#[serde(rename = "discriminator")]
Discriminator,
#[serde(rename = "developer")]
Developer,
#[serde(rename = "tool")]
Tool,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
#[non_exhaustive]
pub enum MessageStatus {
#[serde(rename = "in_progress")]
InProgress,
#[serde(rename = "completed")]
Completed,
#[serde(rename = "incomplete")]
Incomplete,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct Message {
pub id: String,
pub content: Vec<Content>,
pub role: MessageRole,
pub status: MessageStatus,
#[serde(rename = "type")]
pub type_: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct SummaryTextContent {
pub text: String,
#[serde(rename = "type")]
pub type_: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct TextContent {
pub text: String,
#[serde(rename = "type")]
pub type_: String,
}