/*
* OpenAI API
*
* The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
*
* The version of the OpenAPI document: 2.3.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// Tool : A tool that can be used to generate a response.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum Tool {
FunctionTool(Box<models::FunctionTool>),
FileSearchTool(Box<models::FileSearchTool>),
ComputerTool(Box<models::ComputerTool>),
ComputerUsePreviewTool(Box<models::ComputerUsePreviewTool>),
WebSearchTool(Box<models::WebSearchTool>),
McpTool(Box<models::McpTool>),
CodeInterpreterTool(Box<models::CodeInterpreterTool>),
ProgrammaticToolCallingParam(Box<models::ProgrammaticToolCallingParam>),
ImageGenTool(Box<models::ImageGenTool>),
LocalShellToolParam(Box<models::LocalShellToolParam>),
FunctionShellToolParam(Box<models::FunctionShellToolParam>),
CustomToolParam(Box<models::CustomToolParam>),
NamespaceToolParam(Box<models::NamespaceToolParam>),
SearchToolParam(Box<models::ToolSearchToolParam>),
WebSearchPreviewTool(Box<models::WebSearchPreviewTool>),
ApplyPatchToolParam(Box<models::ApplyPatchToolParam>),
}
/// Identifier for service connectors, like those available in ChatGPT. One of `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more about service connectors [here](https://developers.openai.com/api/docs/guides/tools-connectors-mcp#connectors). This field is deprecated for models released after September 1, 2026. Use `server_url` to connect to a remote MCP server, or `tunnel_id` to connect through a Secure MCP Tunnel. Currently supported `connector_id` values are: - Dropbox: `connector_dropbox` - Gmail: `connector_gmail` - Google Calendar: `connector_googlecalendar` - Google Drive: `connector_googledrive` - Microsoft Teams: `connector_microsoftteams` - Outlook Calendar: `connector_outlookcalendar` - Outlook Email: `connector_outlookemail` - SharePoint: `connector_sharepoint`
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ConnectorId {
ConnectorDropbox,
ConnectorGmail,
ConnectorGooglecalendar,
ConnectorGoogledrive,
ConnectorMicrosoftteams,
ConnectorOutlookcalendar,
ConnectorOutlookemail,
ConnectorSharepoint,
}
impl Default for ConnectorId {
fn default() -> ConnectorId {
Self::ConnectorDropbox
}
}
/// The quality of the generated image. The GPT image models support `low`, `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default: `auto`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Quality {
Low,
Medium,
High,
Xhigh,
Max,
Auto,
}
impl Default for Quality {
fn default() -> Quality {
Self::Low
}
}
/// The output format of the generated image. One of `png`, `webp`, or `jpeg`. Default: `png`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum OutputFormat {
Png,
Webp,
Jpeg,
}
impl Default for OutputFormat {
fn default() -> OutputFormat {
Self::Png
}
}
/// Moderation level for the generated image. Default: `auto`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Moderation {
Auto,
Low,
}
impl Default for Moderation {
fn default() -> Moderation {
Self::Auto
}
}
/// Set the background of the generated image. One of `transparent`, `opaque`, or `auto`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, support `opaque` and `transparent` backgrounds. Transparent backgrounds are available for supported GPT Image models. For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, set the output format to `png` or `webp`. Default: `auto`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Background {
Transparent,
Opaque,
Auto,
}
impl Default for Background {
fn default() -> Background {
Self::Transparent
}
}