python-codex 0.3.1__py3-none-any.whl → 0.3.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pycodex/__main__.py ADDED
@@ -0,0 +1,4 @@
1
+ from .cli import main
2
+
3
+ if __name__ == "__main__":
4
+ raise SystemExit(main())
pycodex/model.py CHANGED
@@ -107,8 +107,17 @@ class ResponsesProviderConfig:
107
107
  raise ValueError(f"unknown Codex profile: {profile}")
108
108
  selected.update(overrides)
109
109
 
110
- provider_name = selected["model_provider"]
111
- provider = data["model_providers"][provider_name]
110
+ provider_name = selected.get("model_provider", "openai")
111
+ provider = data.get("model_providers", {}).get(provider_name)
112
+ if provider is None:
113
+ if provider_name != "openai":
114
+ raise ValueError(f"unknown Codex model provider: {provider_name}")
115
+ provider = {
116
+ "base_url": (
117
+ selected.get("openai_base_url") or "https://api.openai.com/v1"
118
+ ),
119
+ "env_key": "OPENAI_API_KEY",
120
+ }
112
121
  wire_api = provider.get("wire_api", "responses")
113
122
  if wire_api != "responses":
114
123
  raise ValueError(f"unsupported wire_api for Python client: {wire_api}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-codex
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: A minimal Python extraction of Codex's main agent loop
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.6.2
@@ -25,6 +25,8 @@ Description-Content-Type: text/markdown
25
25
 
26
26
  English README. Chinese version: `README_ZH.md`
27
27
 
28
+ 0.3.2 startup fixes: [release notes](docs/RELEASE_0.3.2.md).
29
+
28
30
  0.3.0 release preparation and Python API migration: `docs/RELEASE_0.3.0.md`.
29
31
 
30
32
  PyPI distributions:
@@ -60,11 +62,24 @@ Relevant Rust reference points:
60
62
  Install the full package or the workspace-oriented alias:
61
63
 
62
64
  ```bash
63
- pip install python-codex
64
- pip install pycodex-ws
65
+ python3 -m pip install python-codex
66
+ python3 -m pip install pycodex-ws
65
67
  ```
66
68
 
67
- Install dependencies first:
69
+ Use Python 3.6.2 or newer. Both console commands are installed into that
70
+ interpreter's scripts directory. On a machine with multiple Python installations,
71
+ you can select the same interpreter explicitly for startup:
72
+
73
+ ```bash
74
+ python3 -m pycodex
75
+ python3 -m workspace_server --help
76
+ ```
77
+
78
+ If `pycodex` is missing from `PATH` or resolves to an older installation, use these
79
+ module entry points. `python3 -m pip --version` shows which Python environment
80
+ received the installation.
81
+
82
+ For development from this repository, install dependencies first:
68
83
 
69
84
  ```bash
70
85
  uv sync
@@ -200,6 +215,18 @@ from pycodex import ResponsesModelClient
200
215
  client = ResponsesModelClient.from_codex_config()
201
216
  ```
202
217
 
218
+ `model_provider` is optional and defaults to `openai`. The built-in provider
219
+ does not require a `[model_providers.openai]` table: it uses
220
+ `https://api.openai.com/v1` and reads `OPENAI_API_KEY`. Set `openai_base_url` to
221
+ override this address. Explicit provider tables retain their configured
222
+ `base_url` and optional `env_key`; unknown provider names raise a configuration
223
+ error. The model still comes from `model` in the configuration or selected
224
+ profile.
225
+
226
+ Authentication currently uses API keys from environment variables or `.env`;
227
+ Codex desktop/CLI ChatGPT sign-in credentials in `auth.json` or the OS keychain
228
+ are not loaded.
229
+
203
230
  The current implementation uses the streaming OpenAI-compatible `/responses`
204
231
  endpoint. This path has already been validated against the local
205
232
  `~/.codex/config.toml` setup.
@@ -1,4 +1,5 @@
1
1
  pycodex/__init__.py,sha256=4BBGUXImsNBdSQjp2KtshkjQK9BMz5gK93DzpWokkWY,3235
2
+ pycodex/__main__.py,sha256=MHKZ_ae3fSLGTLUUMOx15fWdeOnJSHhq-zslRP5F5Lc,79
2
3
  pycodex/agent.py,sha256=zCIG2DV0oQntLXHFj8FVRkgBp5TCC0YJ7sz0lni9J1s,21177
3
4
  pycodex/bootstrap.py,sha256=DSVx8u94tHRYbUa_e9zdKPqozOv_CrfctbTKZ4JG064,13765
4
5
  pycodex/cli.py,sha256=m5IJhnodNqsfMTIzdwbuaHBl2r-N8x1MxYSpe_hlHiM,12997
@@ -8,7 +9,7 @@ pycodex/doctor.py,sha256=9p624b1zloXbhyMRi1-Of1YtnYeoF4zHxfGFhfujDS4,10620
8
9
  pycodex/events.py,sha256=MZljtqra6-Hnt9Emjbn_wgp5cGaODx1w3CbmIKd5htI,29692
9
10
  pycodex/feishu_card.py,sha256=Gclo4TI3KTfdT5NDLiv58CRg6hH3sUCRXuSrHgXgYjI,27767
10
11
  pycodex/feishu_link.py,sha256=yUbEvO-8g-Bxo8_cF9s6vLZguz3NA6q3qt2A9Q09fsE,14523
11
- pycodex/model.py,sha256=cKG2STZ_Kc3ThelY6KTTRkBTCrIwcmF74Rhfhj71N08,44175
12
+ pycodex/model.py,sha256=HeHeaYEC06idh_66mM4uzyc7IZc_AS789ajByvOqbr8,44571
12
13
  pycodex/model_metadata.py,sha256=RMYhvgkm2v1nhCslSiDXPAwrRAx8FPz9QJqv8QTbWlc,1332
13
14
  pycodex/portable.py,sha256=rfOpVnBZ01RS0Kyjo_w2FNKHY2t-lUcHVtWhPsbp1-k,16158
14
15
  pycodex/portable_server.py,sha256=A4IY3xHtBQLRxdHQ4O5zdaVGjqENaLvypsSkLGZvCZ0,7498
@@ -84,8 +85,8 @@ workspace_server/owned_process.py,sha256=j1cJ89Nm7gS91Zj62kYKabFbb9qhbU7-q1YDsWc
84
85
  workspace_server/workspace.html,sha256=CXrMdUVM9eB03nCVwvC5coc6tMsmplOOx8wLBrJc9cw,71625
85
86
  workspace_server/workspaces.html,sha256=TpmfzpuCIXTVdFQzQrojxSCtBTHMSESn1zNGOmNz_W8,15787
86
87
  workspace_server/workspaces.py,sha256=cyyDBMo0UVqMvCjeAEHNwZCHQzRRsyn7bbYIb0INOo0,22371
87
- python_codex-0.3.1.dist-info/METADATA,sha256=WGqQcyA3LSrEQz0deJJkAotv7P2HSog5lw-ITWaSquw,38398
88
- python_codex-0.3.1.dist-info/WHEEL,sha256=KGYbc1zXlYddvwxnNty23BeaKzh7YuoSIvIMO4jEhvw,87
89
- python_codex-0.3.1.dist-info/entry_points.txt,sha256=vkV2UWCtEKvQNMJuPNjt8HyBKiwp83JyqBatrBNGDp8,80
90
- python_codex-0.3.1.dist-info/licenses/LICENSE,sha256=0X8ifk312hYAORM4hlzg8wVSEXYKNmiPgWlB1YIy2Nw,10926
91
- python_codex-0.3.1.dist-info/RECORD,,
88
+ python_codex-0.3.2.dist-info/METADATA,sha256=PClQOhAVKTGw8gaoYjP_G2pfp6j5QEZQS8uHPccymqg,39624
89
+ python_codex-0.3.2.dist-info/WHEEL,sha256=KGYbc1zXlYddvwxnNty23BeaKzh7YuoSIvIMO4jEhvw,87
90
+ python_codex-0.3.2.dist-info/entry_points.txt,sha256=vkV2UWCtEKvQNMJuPNjt8HyBKiwp83JyqBatrBNGDp8,80
91
+ python_codex-0.3.2.dist-info/licenses/LICENSE,sha256=0X8ifk312hYAORM4hlzg8wVSEXYKNmiPgWlB1YIy2Nw,10926
92
+ python_codex-0.3.2.dist-info/RECORD,,