pub enum CustomToolInputContentPart {
InputText {
text: String,
},
InputImage {
detail: Option<Detail>,
file_id: Option<String>,
image_url: Option<String>,
},
InputFile {
detail: Option<FileDetail>,
file_data: Option<String>,
file_id: Option<String>,
file_url: Option<String>,
filename: Option<String>,
},
}Expand description
Input-only content part accepted inside a custom_tool_call_output array.
Spec (openai-responses-api-spec.md L269): the array form of
custom_tool_call_output.output permits only ResponseInputText | ResponseInputImage | ResponseInputFile — assistant-facing shapes such as
output_text and refusal are explicitly not allowed here. This enum
mirrors the three input variants of ResponseContentPart with identical
field shapes so spec-compliant payloads round-trip unchanged, while
deserialization of output_text/refusal fails loudly instead of being
silently coerced.
Other call sites that legitimately carry mixed input/output content parts
continue to use ResponseContentPart (Postel-of-liberality preserved for
cross-tool reuse).
Variants§
InputText
type: "input_text" — inline textual input.
InputImage
type: "input_image" — reference to an image supplied by the client.
Exactly one of file_id / image_url is typically set; both may be
absent when only detail is being conveyed.
InputFile
type: "input_file" — reference to an attached file. file_data is a
base64 blob; file_url / file_id reference external/uploaded files.
Trait Implementations§
Source§impl Clone for CustomToolInputContentPart
impl Clone for CustomToolInputContentPart
Source§fn clone(&self) -> CustomToolInputContentPart
fn clone(&self) -> CustomToolInputContentPart
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CustomToolInputContentPart
impl Debug for CustomToolInputContentPart
Source§impl<'de> Deserialize<'de> for CustomToolInputContentPart
impl<'de> Deserialize<'de> for CustomToolInputContentPart
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for CustomToolInputContentPart
impl JsonSchema for CustomToolInputContentPart
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more