mirror of
https://github.com/openai/codex.git
synced 2026-05-15 16:53:05 +00:00
Narrow Python SDK root exports
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -10,12 +10,12 @@ This SDK surface is experimental. Turn streams are routed by turn ID so one clie
|
||||
from codex_app_server import (
|
||||
Codex,
|
||||
AsyncCodex,
|
||||
AppServerConfig,
|
||||
RunResult,
|
||||
Thread,
|
||||
AsyncThread,
|
||||
TurnHandle,
|
||||
AsyncTurnHandle,
|
||||
InitializeResponse,
|
||||
Input,
|
||||
InputItem,
|
||||
TextInput,
|
||||
@@ -24,13 +24,14 @@ from codex_app_server import (
|
||||
SkillInput,
|
||||
MentionInput,
|
||||
TurnStatus,
|
||||
retry_on_overload,
|
||||
)
|
||||
from codex_app_server.generated.v2_all import ThreadItem, ThreadTokenUsage
|
||||
```
|
||||
|
||||
- Version: `codex_app_server.__version__`
|
||||
- Requires Python >= 3.10
|
||||
- Canonical generated app-server models live in `codex_app_server.generated.v2_all`
|
||||
- The package root `__all__` is the supported public import surface; generated
|
||||
transport modules are shipped for runtime use but are not re-exported.
|
||||
|
||||
## Codex (sync)
|
||||
|
||||
@@ -165,20 +166,23 @@ InputItem = TextInput | ImageInput | LocalImageInput | SkillInput | MentionInput
|
||||
Input = list[InputItem] | InputItem
|
||||
```
|
||||
|
||||
## Generated Models
|
||||
## Public Value Types
|
||||
|
||||
The SDK wrappers return and accept canonical generated app-server models wherever possible:
|
||||
The package root exports the ergonomic SDK plus selected value types used by
|
||||
public method signatures:
|
||||
|
||||
```python
|
||||
from codex_app_server.generated.v2_all import (
|
||||
from codex_app_server import (
|
||||
AskForApproval,
|
||||
ThreadReadResponse,
|
||||
Turn,
|
||||
TurnStartParams,
|
||||
ReasoningEffort,
|
||||
SandboxPolicy,
|
||||
TurnStatus,
|
||||
)
|
||||
```
|
||||
|
||||
Generated transport modules are shipped for SDK runtime use, but they are not
|
||||
the supported root API.
|
||||
|
||||
## Retry + errors
|
||||
|
||||
```python
|
||||
|
||||
@@ -95,12 +95,12 @@ with Codex() as codex:
|
||||
print(result.final_response)
|
||||
```
|
||||
|
||||
## 6) Generated models
|
||||
## 6) Public value types
|
||||
|
||||
The convenience wrappers live at the package root, but the canonical app-server models live under:
|
||||
The convenience wrappers and selected value types live at the package root:
|
||||
|
||||
```python
|
||||
from codex_app_server.generated.v2_all import Turn, TurnStatus, ThreadReadResponse
|
||||
from codex_app_server import AskForApproval, ReasoningEffort, SandboxPolicy, TurnStatus
|
||||
```
|
||||
|
||||
## 7) Next stops
|
||||
|
||||
Reference in New Issue
Block a user