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:
Krish Chainani
2026-09-14 23:25:09 +00:00
committed by copyberry
parent 6ae5e71458
commit 5a66d460d3
79 changed files with 994 additions and 312 deletions
@@ -7784,8 +7784,8 @@ class InputImageContentItem(BaseModel):
populate_by_name=True,
)
detail: ImageDetail | None = None
image_url: str
type: Annotated[Literal["input_image"], Field(title="InputImageContentItemType")]
image_url: str
class ContentItem(
@@ -7796,9 +7796,7 @@ class ContentItem(
model_config = ConfigDict(
populate_by_name=True,
)
root: (
InputTextContentItem | InputImageContentItem | InputAudioContentItem | OutputTextContentItem
)
root: InputTextContentItem | InputImageContentItem | InputAudioContentItem | OutputTextContentItem
class ExperimentalFeature(BaseModel):
@@ -7980,10 +7978,10 @@ class InputImageFunctionCallOutputContentItem(BaseModel):
populate_by_name=True,
)
detail: ImageDetail | None = None
image_url: str
type: Annotated[
Literal["input_image"], Field(title="InputImageFunctionCallOutputContentItemType")
]
image_url: str
class FunctionCallOutputContentItem(