mirror of
https://github.com/openai/codex.git
synced 2026-11-21 15:10:25 +00:00
Refactor image content to use a shared ImageReference type (#45543)
## What changed Represent images in `ContentItem` and `FunctionCallOutputContentItem` with `ImageReference::Inline`, flattened to preserve the existing `image_url` wire format. Update image producers and consumers and regenerate app-server schemas and SDK artifacts. Preserve the Python SDK's `InputImageContentItem` and `InputImageFunctionCallOutputContentItem` class names during generation. ## Testing Add a regression test for stable Python image class names and adapt existing image tests to the shared representation. GitOrigin-RevId: c38a780ac3314c2ac2deb3afc1b93b94b6f93fec
This commit is contained in:
1 parent
6ae5e71458
commit
5a66d460d3
79 files changed
+994
-312
No files matched your search
+14
-4
@@ -359,6 +359,20 @@
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url"
|
||||
],
|
||||
"title": "ImageUrlFunctionCallOutputContentItem",
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"detail": {
|
||||
"anyOf": [
|
||||
@@ -370,9 +384,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"input_image"
|
||||
@@ -382,7 +393,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url",
|
||||
"type"
|
||||
],
|
||||
"title": "InputImageFunctionCallOutputContentItem",
|
||||
|
||||
@@ -359,6 +359,20 @@
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url"
|
||||
],
|
||||
"title": "ImageUrlFunctionCallOutputContentItem",
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"detail": {
|
||||
"anyOf": [
|
||||
@@ -370,9 +384,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"input_image"
|
||||
@@ -382,7 +393,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url",
|
||||
"type"
|
||||
],
|
||||
"title": "InputImageFunctionCallOutputContentItem",
|
||||
|
||||
+28
-8
@@ -80,6 +80,20 @@
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url"
|
||||
],
|
||||
"title": "ImageUrlContentItem",
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"detail": {
|
||||
"anyOf": [
|
||||
@@ -91,9 +105,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"input_image"
|
||||
@@ -103,7 +114,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url",
|
||||
"type"
|
||||
],
|
||||
"title": "InputImageContentItem",
|
||||
@@ -188,6 +198,20 @@
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url"
|
||||
],
|
||||
"title": "ImageUrlFunctionCallOutputContentItem",
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"detail": {
|
||||
"anyOf": [
|
||||
@@ -199,9 +223,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"input_image"
|
||||
@@ -211,7 +232,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url",
|
||||
"type"
|
||||
],
|
||||
"title": "InputImageFunctionCallOutputContentItem",
|
||||
|
||||
@@ -499,6 +499,20 @@
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url"
|
||||
],
|
||||
"title": "ImageUrlFunctionCallOutputContentItem",
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"detail": {
|
||||
"anyOf": [
|
||||
@@ -510,9 +524,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"input_image"
|
||||
@@ -522,7 +533,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url",
|
||||
"type"
|
||||
],
|
||||
"title": "InputImageFunctionCallOutputContentItem",
|
||||
|
||||
@@ -580,6 +580,20 @@
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url"
|
||||
],
|
||||
"title": "ImageUrlFunctionCallOutputContentItem",
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"detail": {
|
||||
"anyOf": [
|
||||
@@ -591,9 +605,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"input_image"
|
||||
@@ -603,7 +614,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url",
|
||||
"type"
|
||||
],
|
||||
"title": "InputImageFunctionCallOutputContentItem",
|
||||
|
||||
@@ -359,6 +359,20 @@
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url"
|
||||
],
|
||||
"title": "ImageUrlFunctionCallOutputContentItem",
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"detail": {
|
||||
"anyOf": [
|
||||
@@ -370,9 +384,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"input_image"
|
||||
@@ -382,7 +393,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url",
|
||||
"type"
|
||||
],
|
||||
"title": "InputImageFunctionCallOutputContentItem",
|
||||
|
||||
@@ -502,6 +502,20 @@
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url"
|
||||
],
|
||||
"title": "ImageUrlFunctionCallOutputContentItem",
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"detail": {
|
||||
"anyOf": [
|
||||
@@ -513,9 +527,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"input_image"
|
||||
@@ -525,7 +536,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url",
|
||||
"type"
|
||||
],
|
||||
"title": "InputImageFunctionCallOutputContentItem",
|
||||
|
||||
+14
-4
@@ -502,6 +502,20 @@
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url"
|
||||
],
|
||||
"title": "ImageUrlFunctionCallOutputContentItem",
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"detail": {
|
||||
"anyOf": [
|
||||
@@ -513,9 +527,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"input_image"
|
||||
@@ -525,7 +536,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url",
|
||||
"type"
|
||||
],
|
||||
"title": "InputImageFunctionCallOutputContentItem",
|
||||
|
||||
@@ -502,6 +502,20 @@
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url"
|
||||
],
|
||||
"title": "ImageUrlFunctionCallOutputContentItem",
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"detail": {
|
||||
"anyOf": [
|
||||
@@ -513,9 +527,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"input_image"
|
||||
@@ -525,7 +536,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url",
|
||||
"type"
|
||||
],
|
||||
"title": "InputImageFunctionCallOutputContentItem",
|
||||
|
||||
@@ -142,6 +142,20 @@
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url"
|
||||
],
|
||||
"title": "ImageUrlContentItem",
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"detail": {
|
||||
"anyOf": [
|
||||
@@ -153,9 +167,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"input_image"
|
||||
@@ -165,7 +176,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url",
|
||||
"type"
|
||||
],
|
||||
"title": "InputImageContentItem",
|
||||
@@ -250,6 +260,20 @@
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url"
|
||||
],
|
||||
"title": "ImageUrlFunctionCallOutputContentItem",
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"detail": {
|
||||
"anyOf": [
|
||||
@@ -261,9 +285,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"input_image"
|
||||
@@ -273,7 +294,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url",
|
||||
"type"
|
||||
],
|
||||
"title": "InputImageFunctionCallOutputContentItem",
|
||||
|
||||
@@ -596,6 +596,20 @@
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url"
|
||||
],
|
||||
"title": "ImageUrlFunctionCallOutputContentItem",
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"detail": {
|
||||
"anyOf": [
|
||||
@@ -607,9 +621,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"input_image"
|
||||
@@ -619,7 +630,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url",
|
||||
"type"
|
||||
],
|
||||
"title": "InputImageFunctionCallOutputContentItem",
|
||||
|
||||
@@ -502,6 +502,20 @@
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url"
|
||||
],
|
||||
"title": "ImageUrlFunctionCallOutputContentItem",
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"detail": {
|
||||
"anyOf": [
|
||||
@@ -513,9 +527,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"input_image"
|
||||
@@ -525,7 +536,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url",
|
||||
"type"
|
||||
],
|
||||
"title": "InputImageFunctionCallOutputContentItem",
|
||||
|
||||
@@ -580,6 +580,20 @@
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url"
|
||||
],
|
||||
"title": "ImageUrlFunctionCallOutputContentItem",
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"detail": {
|
||||
"anyOf": [
|
||||
@@ -591,9 +605,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"input_image"
|
||||
@@ -603,7 +614,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url",
|
||||
"type"
|
||||
],
|
||||
"title": "InputImageFunctionCallOutputContentItem",
|
||||
|
||||
+14
-4
@@ -502,6 +502,20 @@
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url"
|
||||
],
|
||||
"title": "ImageUrlFunctionCallOutputContentItem",
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"detail": {
|
||||
"anyOf": [
|
||||
@@ -513,9 +527,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"input_image"
|
||||
@@ -525,7 +536,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url",
|
||||
"type"
|
||||
],
|
||||
"title": "InputImageFunctionCallOutputContentItem",
|
||||
|
||||
@@ -499,6 +499,20 @@
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url"
|
||||
],
|
||||
"title": "ImageUrlFunctionCallOutputContentItem",
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"detail": {
|
||||
"anyOf": [
|
||||
@@ -510,9 +524,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"input_image"
|
||||
@@ -522,7 +533,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url",
|
||||
"type"
|
||||
],
|
||||
"title": "InputImageFunctionCallOutputContentItem",
|
||||
|
||||
@@ -502,6 +502,20 @@
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url"
|
||||
],
|
||||
"title": "ImageUrlFunctionCallOutputContentItem",
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"detail": {
|
||||
"anyOf": [
|
||||
@@ -513,9 +527,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"input_image"
|
||||
@@ -525,7 +536,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url",
|
||||
"type"
|
||||
],
|
||||
"title": "InputImageFunctionCallOutputContentItem",
|
||||
|
||||
+14
-4
@@ -499,6 +499,20 @@
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url"
|
||||
],
|
||||
"title": "ImageUrlFunctionCallOutputContentItem",
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"detail": {
|
||||
"anyOf": [
|
||||
@@ -510,9 +524,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"input_image"
|
||||
@@ -522,7 +533,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url",
|
||||
"type"
|
||||
],
|
||||
"title": "InputImageFunctionCallOutputContentItem",
|
||||
|
||||
@@ -166,6 +166,20 @@
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url"
|
||||
],
|
||||
"title": "ImageUrlFunctionCallOutputContentItem",
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"detail": {
|
||||
"anyOf": [
|
||||
@@ -177,9 +191,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"input_image"
|
||||
@@ -189,7 +200,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url",
|
||||
"type"
|
||||
],
|
||||
"title": "InputImageFunctionCallOutputContentItem",
|
||||
|
||||
@@ -499,6 +499,20 @@
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url"
|
||||
],
|
||||
"title": "ImageUrlFunctionCallOutputContentItem",
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"detail": {
|
||||
"anyOf": [
|
||||
@@ -510,9 +524,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"input_image"
|
||||
@@ -522,7 +533,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url",
|
||||
"type"
|
||||
],
|
||||
"title": "InputImageFunctionCallOutputContentItem",
|
||||
|
||||
@@ -499,6 +499,20 @@
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"properties": {
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url"
|
||||
],
|
||||
"title": "ImageUrlFunctionCallOutputContentItem",
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"detail": {
|
||||
"anyOf": [
|
||||
@@ -510,9 +524,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"image_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"input_image"
|
||||
@@ -522,7 +533,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image_url",
|
||||
"type"
|
||||
],
|
||||
"title": "InputImageFunctionCallOutputContentItem",
|
||||
|
||||
Reference in new issue
Block a user