/*
* 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};
/// BetaTool : A tool that can be used to generate a response.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum BetaTool {
BetaFunctionTool(Box<models::BetaFunctionTool>),
BetaFileSearchTool(Box<models::BetaFileSearchTool>),
BetaComputerTool(Box<models::BetaComputerTool>),
BetaComputerUsePreviewTool(Box<models::BetaComputerUsePreviewTool>),
BetaWebSearchTool(Box<models::BetaWebSearchTool>),
BetaMcpTool(Box<models::BetaMcpTool>),
BetaCodeInterpreterTool(Box<models::BetaCodeInterpreterTool>),
BetaProgrammaticToolCallingParam(Box<models::BetaProgrammaticToolCallingParam>),
BetaImageGenTool(Box<models::BetaImageGenTool>),
BetaLocalShellToolParam(Box<models::BetaLocalShellToolParam>),
BetaFunctionShellToolParam(Box<models::BetaFunctionShellToolParam>),
BetaCustomToolParam(Box<models::BetaCustomToolParam>),
BetaNamespaceToolParam(Box<models::BetaNamespaceToolParam>),
SearchToolParam(Box<models::BetaToolSearchToolParam>),
BetaWebSearchPreviewTool(Box<models::BetaWebSearchPreviewTool>),
BetaApplyPatchToolParam(Box<models::BetaApplyPatchToolParam>),
}
/// 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
}
}