Preserve ImageUserInput in the Python SDK (#45796)

Keep the existing public class name for URL-based image input when regenerating the SDK. Map `UrlUserInput` to `ImageUserInput` during artifact generation and update the generated model and `UserInput` union accordingly.

Extend the class-name stability test to assert that `ImageUserInput` remains importable under its expected name.

GitOrigin-RevId: 6cbbd555e2e07904cc5fbc279e1e61ff089ac0a9
This commit is contained in:
Krish Chainani
2026-09-15 21:20:51 +00:00
committed by copyberry
parent 7b8b17b97a
commit 63c09ed212
3 changed files with 6 additions and 3 deletions
@@ -587,6 +587,7 @@ def _preserve_inline_image_class_names(out_path: Path) -> None:
"""Keep the public class names used before ImageReference was introduced."""
source = out_path.read_text()
stable_names = {
"UrlUserInput": "ImageUserInput",
"ImageUrlContentItem": "InputImageContentItem",
"ImageUrlFunctionCallOutputContentItem": "InputImageFunctionCallOutputContentItem",
}