Rename Python SDK package to openai-codex

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Ahmed Ibrahim
2026-05-09 11:38:22 +03:00
parent 9306e60848
commit 78c0d5ca3d
63 changed files with 152 additions and 152 deletions

View File

@@ -15,7 +15,7 @@ ensure_local_sdk_src()
import asyncio
from codex_app_server import AsyncCodex
from openai_codex import AsyncCodex
async def main() -> None:

View File

@@ -13,7 +13,7 @@ from _bootstrap import (
ensure_local_sdk_src()
from codex_app_server import Codex
from openai_codex import Codex
with Codex(config=runtime_config()) as codex:
print("Server:", server_label(codex.metadata))

View File

@@ -16,7 +16,7 @@ ensure_local_sdk_src()
import asyncio
from codex_app_server import AsyncCodex, TextInput
from openai_codex import AsyncCodex, TextInput
async def main() -> None:

View File

@@ -14,7 +14,7 @@ from _bootstrap import (
ensure_local_sdk_src()
from codex_app_server import Codex, TextInput
from openai_codex import Codex, TextInput
with Codex(config=runtime_config()) as codex:
thread = codex.thread_start(model="gpt-5.4", config={"model_reasoning_effort": "high"})

View File

@@ -16,7 +16,7 @@ ensure_local_sdk_src()
import asyncio
from codex_app_server import AsyncCodex, TextInput
from openai_codex import AsyncCodex, TextInput
async def main() -> None:

View File

@@ -14,7 +14,7 @@ from _bootstrap import (
ensure_local_sdk_src()
from codex_app_server import Codex, TextInput
from openai_codex import Codex, TextInput
with Codex(config=runtime_config()) as codex:
thread = codex.thread_start(model="gpt-5.4", config={"model_reasoning_effort": "high"})

View File

@@ -11,7 +11,7 @@ ensure_local_sdk_src()
import asyncio
from codex_app_server import AsyncCodex
from openai_codex import AsyncCodex
async def main() -> None:

View File

@@ -9,7 +9,7 @@ from _bootstrap import ensure_local_sdk_src, runtime_config, server_label
ensure_local_sdk_src()
from codex_app_server import Codex
from openai_codex import Codex
with Codex(config=runtime_config()) as codex:
print("server:", server_label(codex.metadata))

View File

@@ -11,7 +11,7 @@ ensure_local_sdk_src()
import asyncio
from codex_app_server import AsyncCodex, TextInput
from openai_codex import AsyncCodex, TextInput
async def main() -> None:

View File

@@ -9,7 +9,7 @@ from _bootstrap import assistant_text_from_turn, ensure_local_sdk_src, find_turn
ensure_local_sdk_src()
from codex_app_server import Codex, TextInput
from openai_codex import Codex, TextInput
with Codex(config=runtime_config()) as codex:
# Create an initial thread and turn so we have a real thread to resume.

View File

@@ -11,7 +11,7 @@ ensure_local_sdk_src()
import asyncio
from codex_app_server import AsyncCodex, TextInput
from openai_codex import AsyncCodex, TextInput
async def main() -> None:

View File

@@ -9,7 +9,7 @@ from _bootstrap import ensure_local_sdk_src, runtime_config
ensure_local_sdk_src()
from codex_app_server import Codex, TextInput
from openai_codex import Codex, TextInput
with Codex(config=runtime_config()) as codex:

View File

@@ -16,7 +16,7 @@ ensure_local_sdk_src()
import asyncio
from codex_app_server import AsyncCodex, ImageInput, TextInput
from openai_codex import AsyncCodex, ImageInput, TextInput
REMOTE_IMAGE_URL = "https://raw.githubusercontent.com/github/explore/main/topics/python/python.png"

View File

@@ -14,7 +14,7 @@ from _bootstrap import (
ensure_local_sdk_src()
from codex_app_server import Codex, ImageInput, TextInput
from openai_codex import Codex, ImageInput, TextInput
REMOTE_IMAGE_URL = "https://raw.githubusercontent.com/github/explore/main/topics/python/python.png"

View File

@@ -17,7 +17,7 @@ ensure_local_sdk_src()
import asyncio
from codex_app_server import AsyncCodex, LocalImageInput, TextInput
from openai_codex import AsyncCodex, LocalImageInput, TextInput
async def main() -> None:

View File

@@ -15,7 +15,7 @@ from _bootstrap import (
ensure_local_sdk_src()
from codex_app_server import Codex, LocalImageInput, TextInput
from openai_codex import Codex, LocalImageInput, TextInput
with temporary_sample_image_path() as image_path:
with Codex(config=runtime_config()) as codex:

View File

@@ -15,7 +15,7 @@ from _bootstrap import (
ensure_local_sdk_src()
from codex_app_server import Codex, TextInput
from openai_codex import Codex, TextInput
with Codex(config=runtime_config()) as codex:
print("Server:", server_label(codex.metadata))

View File

@@ -19,14 +19,14 @@ import random
from collections.abc import Awaitable, Callable
from typing import TypeVar
from codex_app_server import (
from openai_codex import (
AsyncCodex,
JsonRpcError,
ServerBusyError,
TextInput,
is_retryable_error,
)
from codex_app_server.types import TurnStatus
from openai_codex.types import TurnStatus
ResultT = TypeVar("ResultT")

View File

@@ -14,14 +14,14 @@ from _bootstrap import (
ensure_local_sdk_src()
from codex_app_server import (
from openai_codex import (
Codex,
JsonRpcError,
ServerBusyError,
TextInput,
retry_on_overload,
)
from codex_app_server.types import TurnStatus
from openai_codex.types import TurnStatus
with Codex(config=runtime_config()) as codex:
thread = codex.thread_start(model="gpt-5.4", config={"model_reasoning_effort": "high"})

View File

@@ -11,11 +11,11 @@ ensure_local_sdk_src()
import asyncio
from codex_app_server import (
from openai_codex import (
AsyncCodex,
TextInput,
)
from codex_app_server.types import (
from openai_codex.types import (
ThreadTokenUsageUpdatedNotification,
TurnCompletedNotification,
)

View File

@@ -9,11 +9,11 @@ from _bootstrap import ensure_local_sdk_src, runtime_config
ensure_local_sdk_src()
from codex_app_server import (
from openai_codex import (
Codex,
TextInput,
)
from codex_app_server.types import (
from openai_codex.types import (
ThreadTokenUsageUpdatedNotification,
TurnCompletedNotification,
)

View File

@@ -17,11 +17,11 @@ ensure_local_sdk_src()
import asyncio
from codex_app_server import (
from openai_codex import (
AsyncCodex,
TextInput,
)
from codex_app_server.types import (
from openai_codex.types import (
AskForApproval,
Personality,
ReasoningSummary,

View File

@@ -15,11 +15,11 @@ from _bootstrap import (
ensure_local_sdk_src()
from codex_app_server import (
from openai_codex import (
Codex,
TextInput,
)
from codex_app_server.types import (
from openai_codex.types import (
AskForApproval,
Personality,
ReasoningSummary,

View File

@@ -11,11 +11,11 @@ ensure_local_sdk_src()
import asyncio
from codex_app_server import (
from openai_codex import (
AsyncCodex,
TextInput,
)
from codex_app_server.types import (
from openai_codex.types import (
AskForApproval,
Personality,
ReasoningEffort,

View File

@@ -9,11 +9,11 @@ from _bootstrap import assistant_text_from_turn, ensure_local_sdk_src, find_turn
ensure_local_sdk_src()
from codex_app_server import (
from openai_codex import (
Codex,
TextInput,
)
from codex_app_server.types import (
from openai_codex.types import (
AskForApproval,
Personality,
ReasoningEffort,

View File

@@ -15,7 +15,7 @@ ensure_local_sdk_src()
import asyncio
from codex_app_server import AsyncCodex, TextInput
from openai_codex import AsyncCodex, TextInput
async def main() -> None:

View File

@@ -13,7 +13,7 @@ from _bootstrap import (
ensure_local_sdk_src()
from codex_app_server import Codex, TextInput
from openai_codex import Codex, TextInput
with Codex(config=runtime_config()) as codex:
thread = codex.thread_start(model="gpt-5.4", config={"model_reasoning_effort": "high"})

View File

@@ -5,8 +5,8 @@ Each example folder contains runnable versions:
- `sync.py` (public sync surface: `Codex`)
- `async.py` (public async surface: `AsyncCodex`)
All examples intentionally use only public SDK exports from `codex_app_server`
and `codex_app_server.types`.
All examples intentionally use only public SDK exports from `openai_codex`
and `openai_codex.types`.
## Prerequisites

View File

@@ -35,7 +35,7 @@ def ensure_local_sdk_src() -> Path:
"""Add sdk/python/src to sys.path so examples run without installing the package."""
sdk_python_dir = _SDK_PYTHON_DIR
src_dir = sdk_python_dir / "src"
package_dir = src_dir / "codex_app_server"
package_dir = src_dir / "openai_codex"
if not package_dir.exists():
raise RuntimeError(f"Could not locate local SDK package at {package_dir}")
@@ -49,7 +49,7 @@ def ensure_local_sdk_src() -> Path:
def runtime_config():
"""Return an example-friendly AppServerConfig for repo-source SDK usage."""
from codex_app_server import AppServerConfig
from openai_codex import AppServerConfig
ensure_runtime_package_installed(sys.executable, _SDK_PYTHON_DIR)
return AppServerConfig()