mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
[sdk/python] Stop advertising HTTP image URLs (#29464)
## Summary - use generated image data URLs in the Python SDK examples and notebook - document HTTP and HTTPS image URLs as deprecated and recommend `LocalImageInput` - replace the remote-URL integration test with data-URL coverage `ImageInput` remains available for data URLs. The SDK does not duplicate app-server URL validation. ## Testing - `uv run --frozen --no-sync ruff check --output-format=full .` - `uv run --frozen --no-sync ruff format --check .` - full Python SDK test suite with an isolated writable `CODEX_SQLITE_HOME` (119 passed, 38 skipped)
This commit is contained in:
committed by
GitHub
Unverified
parent
5b95745eae
commit
20431d49a0
@@ -1,5 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import base64
|
||||
import contextlib
|
||||
import importlib.util
|
||||
import sys
|
||||
@@ -95,6 +96,11 @@ def _generated_sample_png_bytes() -> bytes:
|
||||
)
|
||||
|
||||
|
||||
def generated_sample_image_data_url() -> str:
|
||||
encoded = base64.b64encode(_generated_sample_png_bytes()).decode("ascii")
|
||||
return f"data:image/png;base64,{encoded}"
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def temporary_sample_image_path() -> Iterator[Path]:
|
||||
with tempfile.TemporaryDirectory(prefix="codex-python-example-image-") as temp_root:
|
||||
|
||||
Reference in New Issue
Block a user