mirror of
https://github.com/openai/codex.git
synced 2026-09-04 15:08:45 +00:00
## What changed - Add `inputAudio` content items to dynamic tool responses, app-server events, thread history, and generated protocol schemas. - Add an `audio()` code-mode helper that accepts inline data URLs, audio URL objects, and MCP audio blocks. - Convert MCP audio blocks into model input when audio is supported, and replace unsupported audio with an explanatory text item. - Reject non-data audio URLs and track audio item counts in dynamic tool analytics. ## Testing - Cover audio serialization, protocol round trips, thread-history conversion, MCP modality filtering, code-mode helper inputs, and invalid URL handling. GitOrigin-RevId: 1ed52a8f9c62d4840fb71c5ec736b4a3566243d6
30 lines
689 B
Rust
30 lines
689 B
Rust
use serde::Deserialize;
|
|
use serde::Serialize;
|
|
|
|
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
|
|
#[serde(rename_all = "lowercase")]
|
|
pub enum ImageDetail {
|
|
Auto,
|
|
Low,
|
|
High,
|
|
Original,
|
|
}
|
|
|
|
pub const DEFAULT_IMAGE_DETAIL: ImageDetail = ImageDetail::High;
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
|
#[serde(tag = "type", rename_all = "snake_case")]
|
|
pub enum FunctionCallOutputContentItem {
|
|
InputText {
|
|
text: String,
|
|
},
|
|
InputImage {
|
|
image_url: String,
|
|
#[serde(default, skip_serializing_if = "Option::is_none")]
|
|
detail: Option<ImageDetail>,
|
|
},
|
|
InputAudio {
|
|
audio_url: String,
|
|
},
|
|
}
|