mirror of
https://github.com/openai/codex.git
synced 2026-09-14 11:57:03 +00:00
## TL;DR WIP esp the examples Thin the Python SDK public surface so the wrapper layer returns canonical app-server generated models directly. - keeps `Codex` / `AsyncCodex` / `Thread` / `Turn` and input helpers, but removes alias-only type layers and custom result models - `metadata` now returns `InitializeResponse` and `run()` returns the generated app-server `Turn` - updates docs, examples, notebook, and tests to use canonical generated types and regenerates `v2_all.py` against current schema - keeps the pinned runtime-package integration flow and real integration coverage ## Validation - `PYTHONPATH=sdk/python/src python3 -m pytest sdk/python/tests` - `GH_TOKEN="$(gh auth token)" RUN_REAL_CODEX_TESTS=1 PYTHONPATH=sdk/python/src python3 -m pytest sdk/python/tests -rs` --------- Co-authored-by: Codex <noreply@openai.com>
112 lines
2.3 KiB
Python
112 lines
2.3 KiB
Python
from .async_client import AsyncAppServerClient
|
|
from .client import AppServerClient, AppServerConfig
|
|
from .errors import (
|
|
AppServerError,
|
|
AppServerRpcError,
|
|
InternalRpcError,
|
|
InvalidParamsError,
|
|
InvalidRequestError,
|
|
JsonRpcError,
|
|
MethodNotFoundError,
|
|
ParseError,
|
|
RetryLimitExceededError,
|
|
ServerBusyError,
|
|
TransportClosedError,
|
|
is_retryable_error,
|
|
)
|
|
from .generated.v2_all import (
|
|
AskForApproval,
|
|
Personality,
|
|
PlanType,
|
|
ReasoningEffort,
|
|
ReasoningSummary,
|
|
SandboxMode,
|
|
SandboxPolicy,
|
|
ServiceTier,
|
|
ThreadItem,
|
|
ThreadForkParams,
|
|
ThreadListParams,
|
|
ThreadResumeParams,
|
|
ThreadSortKey,
|
|
ThreadSourceKind,
|
|
ThreadStartParams,
|
|
ThreadTokenUsageUpdatedNotification,
|
|
TurnCompletedNotification,
|
|
TurnStartParams,
|
|
TurnStatus,
|
|
TurnSteerParams,
|
|
)
|
|
from .models import InitializeResponse
|
|
from .api import (
|
|
AsyncCodex,
|
|
AsyncThread,
|
|
AsyncTurnHandle,
|
|
Codex,
|
|
ImageInput,
|
|
Input,
|
|
InputItem,
|
|
LocalImageInput,
|
|
MentionInput,
|
|
SkillInput,
|
|
TextInput,
|
|
Thread,
|
|
TurnHandle,
|
|
)
|
|
from .retry import retry_on_overload
|
|
|
|
__version__ = "0.2.0"
|
|
|
|
__all__ = [
|
|
"__version__",
|
|
"AppServerClient",
|
|
"AsyncAppServerClient",
|
|
"AppServerConfig",
|
|
"Codex",
|
|
"AsyncCodex",
|
|
"Thread",
|
|
"AsyncThread",
|
|
"TurnHandle",
|
|
"AsyncTurnHandle",
|
|
"InitializeResponse",
|
|
"Input",
|
|
"InputItem",
|
|
"TextInput",
|
|
"ImageInput",
|
|
"LocalImageInput",
|
|
"SkillInput",
|
|
"MentionInput",
|
|
"ThreadItem",
|
|
"ThreadTokenUsageUpdatedNotification",
|
|
"TurnCompletedNotification",
|
|
"AskForApproval",
|
|
"Personality",
|
|
"PlanType",
|
|
"ReasoningEffort",
|
|
"ReasoningSummary",
|
|
"SandboxMode",
|
|
"SandboxPolicy",
|
|
"ServiceTier",
|
|
"ThreadStartParams",
|
|
"ThreadResumeParams",
|
|
"ThreadListParams",
|
|
"ThreadSortKey",
|
|
"ThreadSourceKind",
|
|
"ThreadForkParams",
|
|
"TurnStatus",
|
|
"TurnStartParams",
|
|
"TurnSteerParams",
|
|
"retry_on_overload",
|
|
"AppServerError",
|
|
"TransportClosedError",
|
|
"JsonRpcError",
|
|
"AppServerRpcError",
|
|
"ParseError",
|
|
"InvalidRequestError",
|
|
"MethodNotFoundError",
|
|
"InvalidParamsError",
|
|
"InternalRpcError",
|
|
"ServerBusyError",
|
|
"RetryLimitExceededError",
|
|
"is_retryable_error",
|
|
]
|