python-codex 0.6.0__tar.gz → 0.6.1__tar.gz
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.
- python_codex-0.6.1/PKG-INFO +201 -0
- python_codex-0.6.1/README.md +181 -0
- python_codex-0.6.1/README_ZH.md +175 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/__init__.py +4 -4
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/bootstrap.py +10 -12
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/cli.py +0 -14
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/context.py +3 -4
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/events.py +1 -1
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/model.py +16 -7
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/prompts/models.json +14 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/protocol.py +3 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/__init__.py +9 -10
- python_codex-0.6.1/pycodex/tools/clock_tool.py +114 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/exec_runtime.py +29 -78
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/exec_tool.py +2 -6
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/utils/compat.py +41 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/utils/dotenv.py +0 -7
- python_codex-0.6.1/pycodex/utils/history.py +59 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/utils/session_persist.py +33 -19
- {python_codex-0.6.0 → python_codex-0.6.1}/pyproject.toml +2 -2
- {python_codex-0.6.0 → python_codex-0.6.1}/responses_server/app.py +3 -1
- {python_codex-0.6.0 → python_codex-0.6.1}/responses_server/config.py +6 -1
- python_codex-0.6.1/responses_server/gemini_api.py +333 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/responses_server/messages_api.py +9 -1
- {python_codex-0.6.0 → python_codex-0.6.1}/responses_server/request_translation.py +6 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/responses_server/stream_router.py +15 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/responses_server/tools/web_search.py +3 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/responses_server/transport.py +75 -19
- python_codex-0.6.0/PKG-INFO +0 -352
- python_codex-0.6.0/README.md +0 -332
- python_codex-0.6.0/README_ZH.md +0 -233
- python_codex-0.6.0/pycodex/tools/clock_tool.py +0 -64
- python_codex-0.6.0/pycodex/tools/request_user_input_tool.py +0 -82
- python_codex-0.6.0/pycodex/utils/history.py +0 -33
- {python_codex-0.6.0 → python_codex-0.6.1}/.gitignore +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/LICENSE +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/__main__.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/agent.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/config.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/multi_agents.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/portable/__init__.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/portable/client.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/portable/protocol.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/portable/server.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/prompts/default_base_instructions.md +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/prompts/developer_messages.json +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/prompts/goals/budget_limit.md +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/prompts/goals/continuation.md +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/prompts/permissions/approval_policy/never.md +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/prompts/permissions/approval_policy/on_failure.md +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/prompts/permissions/approval_policy/on_request.md +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/prompts/permissions/approval_policy/on_request_rule_request_permission.md +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/prompts/permissions/approval_policy/unless_trusted.md +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/prompts/permissions/sandbox_mode/danger_full_access.md +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/prompts/permissions/sandbox_mode/read_only.md +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/prompts/permissions/sandbox_mode/workspace_write.md +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/runtime.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/agent_tool_schemas.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/apply_patch_tool.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/base_tool.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/clock_manager.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/code_mode_manager.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/exec_command_tool.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/followup_task_tool.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/goal_manager.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/goal_tool.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/grep_files_tool.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/interrupt_agent_tool.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/list_agents_tool.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/list_dir_tool.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/python_tool_schema.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/read_file_tool.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/request_permissions_tool.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/runtime_services.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/send_message_tool.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/shell_command_tool.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/shell_tool.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/spawn_agent_tool.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/unified_exec_manager.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/update_plan_tool.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/view_image_tool.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/wait_agent_tool.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/wait_tool.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/web_search_tool.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/tools/write_stdin_tool.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/utils/__init__.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/utils/_aes_gcm/LICENSE +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/utils/_aes_gcm/README.md +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/utils/_aes_gcm/__init__.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/utils/_aes_gcm/aes.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/utils/_aes_gcm/gcm.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/utils/_aes_gcm/source-sha256.json +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/utils/async_bridge.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/utils/codex_config.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/utils/compactor.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/utils/crypto.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/utils/debug.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/utils/doctor.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/utils/event_helpers.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/utils/get_env.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/utils/image_utils.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/utils/model_metadata.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/utils/random_ids.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/pycodex/utils/truncation.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/responses_server/__init__.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/responses_server/__main__.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/responses_server/payload_processors.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/responses_server/server.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/responses_server/session_store.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/responses_server/stream_events.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/responses_server/tools/__init__.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/responses_server/tools/custom_adapter.py +0 -0
- {python_codex-0.6.0 → python_codex-0.6.1}/responses_server/trajectory_dump.py +0 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: python-codex
|
|
3
|
+
Version: 0.6.1
|
|
4
|
+
Summary: A minimal Python extraction of Codex's main agent loop
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Requires-Python: >=3.6.2
|
|
7
|
+
Requires-Dist: dataclasses>=0.8; python_version < '3.7'
|
|
8
|
+
Requires-Dist: importlib-metadata>=4.8.3; python_version < '3.8'
|
|
9
|
+
Requires-Dist: loguru>=0.7.3
|
|
10
|
+
Requires-Dist: prompt-toolkit>=3.0.36
|
|
11
|
+
Requires-Dist: pyyaml>=6.0
|
|
12
|
+
Requires-Dist: requests>=2.27.1
|
|
13
|
+
Requires-Dist: starlette<0.20,>=0.19.1; python_version < '3.7'
|
|
14
|
+
Requires-Dist: starlette>=0.19.1; python_version >= '3.7'
|
|
15
|
+
Requires-Dist: tomli<2,>=1.2.3; python_version < '3.11'
|
|
16
|
+
Requires-Dist: typing-extensions>=4.1.1; python_version < '3.8'
|
|
17
|
+
Requires-Dist: uvicorn<0.17,>=0.16.0; python_version < '3.7'
|
|
18
|
+
Requires-Dist: uvicorn>=0.16.0; python_version >= '3.7'
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# pycodex
|
|
22
|
+
|
|
23
|
+
[中文](README_ZH.md)
|
|
24
|
+
|
|
25
|
+
pycodex is a Python implementation of the [Codex](https://github.com/openai/codex)
|
|
26
|
+
coding agent. Use it in a terminal, in a browser, or from your own Python code.
|
|
27
|
+
It supports file editing, command execution, multiple agents and saved sessions.
|
|
28
|
+
See [upstream alignment](docs/ALIGNMENT.md) for the supported scope and differences.
|
|
29
|
+
|
|
30
|
+
## Install
|
|
31
|
+
|
|
32
|
+
| Package | Includes | Python |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| `python-codex` | CLI and Python API | 3.6.2+ |
|
|
35
|
+
| `pycodex-ws` | Core plus browser workspace and optional Feishu integration | 3.7+ |
|
|
36
|
+
|
|
37
|
+
For the CLI and Python API:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
python3 -m pip install --upgrade python-codex
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
For the browser workspace, install `pycodex-ws`; it includes the matching core version:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
python3 -m pip install --upgrade pycodex-ws
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Configure a model
|
|
50
|
+
|
|
51
|
+
Create `~/.codex/config.toml`. For example, with OpenAI:
|
|
52
|
+
|
|
53
|
+
```toml
|
|
54
|
+
model = "gpt-5.4"
|
|
55
|
+
model_provider = "openai"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Supply the API key through the environment or `~/.codex/.env`:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
export OPENAI_API_KEY="your-api-key"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
For another provider, configure its `base_url` and `env_key`. Select the API with
|
|
65
|
+
`compat_api` in the profile or provider table:
|
|
66
|
+
|
|
67
|
+
| `compat_api` | API |
|
|
68
|
+
| --- | --- |
|
|
69
|
+
| `"none"` (default) | Responses |
|
|
70
|
+
| `"chat_completions"` | Chat Completions, including Step |
|
|
71
|
+
| `"messages"` | Claude Messages |
|
|
72
|
+
| `"gemini"` | Gemini API |
|
|
73
|
+
|
|
74
|
+
Legacy `use_chat_completion = true/false` remains supported as `chat_completions/none`.
|
|
75
|
+
|
|
76
|
+
Use `--profile NAME` to select `NAME.config.toml` beside the base config or an
|
|
77
|
+
embedded `[profiles.NAME]` table. Use `--config PATH` for a different config file,
|
|
78
|
+
and `pycodex doctor` to check configuration and connectivity.
|
|
79
|
+
The browser workspace picks up profile changes for new sessions without a restart.
|
|
80
|
+
|
|
81
|
+
See [configuration](docs/CONTEXT.md#配置读取与-profile) and the
|
|
82
|
+
[Gemini setup example](docs/responses_server/README.md#gemini-api).
|
|
83
|
+
Gemini 4 Argon includes a prompt adapted from Antigravity.
|
|
84
|
+
Gemini tool arguments stream as they are generated; tools run after the complete call is received.
|
|
85
|
+
|
|
86
|
+
## Use the CLI
|
|
87
|
+
|
|
88
|
+
Run these commands from your project directory:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
pycodex
|
|
92
|
+
pycodex "Summarize this repository."
|
|
93
|
+
pycodex --profile my_profile "Review the latest changes."
|
|
94
|
+
pycodex --json "Summarize this repository."
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The first command starts an interactive session; the others run a single task.
|
|
98
|
+
The agent can edit files and run commands with your user account's permissions.
|
|
99
|
+
|
|
100
|
+
| Command | Purpose |
|
|
101
|
+
| --- | --- |
|
|
102
|
+
| `/model`, `/effort` | View or change the model and reasoning effort |
|
|
103
|
+
| `/cd <directory>` | Change directory while idle |
|
|
104
|
+
| `/title`, `/history` | Manage the title and inspect conversation history |
|
|
105
|
+
| `/resume` | List or resume saved sessions |
|
|
106
|
+
| `/compact` | Summarize history to free context |
|
|
107
|
+
| `/queue <message>` | Submit a task after the current one finishes |
|
|
108
|
+
|
|
109
|
+
Send a message while the agent is working to redirect it, or use `/queue` to
|
|
110
|
+
wait. Sessions are saved under `~/.codex/sessions` by default.
|
|
111
|
+
Ctrl+C or Ctrl+D closes the session after issued operations finish.
|
|
112
|
+
Run `pycodex --help` for all options.
|
|
113
|
+
|
|
114
|
+
For a local vLLM server:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
pycodex --vllm-endpoint http://127.0.0.1:18000
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Use the browser workspace
|
|
121
|
+
|
|
122
|
+
After installing `pycodex-ws`, create `workspaces.json`:
|
|
123
|
+
|
|
124
|
+
```json
|
|
125
|
+
{
|
|
126
|
+
"workspaces": [
|
|
127
|
+
{"id": "demo", "work_dir": ".", "state_path": "demo", "enable_board": true}
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Start the server and keep the terminal open:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
pycodex-ws --listen 127.0.0.1:6007 --workspace-config workspaces.json
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Open `http://127.0.0.1:6007`. The workspace uses the same model configuration as
|
|
139
|
+
the CLI and provides conversations, a live HTML Canvas, and file/diff viewers.
|
|
140
|
+
Click file links to inspect code, then select text and use **Insert into chat**
|
|
141
|
+
to include it in your next message.
|
|
142
|
+
|
|
143
|
+
The settings menu provides interface customization and password-protected
|
|
144
|
+
workspace sharing. See the [workspace guide](packages/pycodex-ws/README.md) for
|
|
145
|
+
session controls, storage and Feishu setup. A separate
|
|
146
|
+
[VS Code extension](packages/pycodex-ws/extensions/vscode/README.md) connects to
|
|
147
|
+
the same backend, including over Remote SSH.
|
|
148
|
+
|
|
149
|
+
## Use the Python API
|
|
150
|
+
|
|
151
|
+
Save this as `example.py` and run `python3 example.py`. It uses the model
|
|
152
|
+
configuration above and the standard tools:
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
from contextlib import closing
|
|
156
|
+
|
|
157
|
+
from pycodex import AgentsManager, CodexConfig
|
|
158
|
+
from pycodex.bootstrap import build_model
|
|
159
|
+
from pycodex.utils.async_bridge import run_async
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
async def main():
|
|
163
|
+
config = CodexConfig.from_env()
|
|
164
|
+
with closing(build_model(config.provider)) as model:
|
|
165
|
+
runtime = AgentsManager(
|
|
166
|
+
model.client, config.context,
|
|
167
|
+
).create_root_runtime()
|
|
168
|
+
try:
|
|
169
|
+
await runtime.start()
|
|
170
|
+
receipt = await runtime.submit_input("Summarize this repository.")
|
|
171
|
+
print((await receipt.future).output_text)
|
|
172
|
+
finally:
|
|
173
|
+
await runtime.close()
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
run_async(main())
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
`AgentsManager` creates the runtime; `submit_input` submits work.
|
|
180
|
+
Await `receipt.future` for the result. The example closes the runtime and any
|
|
181
|
+
local compatibility server when finished. See [runtime contracts](docs/RUNTIME.md#ownership) for
|
|
182
|
+
custom models, tools and integrations.
|
|
183
|
+
|
|
184
|
+
## More features
|
|
185
|
+
|
|
186
|
+
- [Portable configuration](docs/PORTABLE.md): transfer encrypted configuration, instructions and skills to another machine.
|
|
187
|
+
- [Frontend customization](packages/pycodex-ws/README.md#customize-the-interface): change the workspace through an Agent conversation or your own CSS/JavaScript.
|
|
188
|
+
- [Responses compatibility server](docs/responses_server/README.md): expose a supported backend through the Responses API.
|
|
189
|
+
- [Retries and fallback models](docs/RUNTIME.md#responses-reliability): configure recovery from model failures.
|
|
190
|
+
|
|
191
|
+
## Development
|
|
192
|
+
|
|
193
|
+
From the repository root:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
env -u VIRTUAL_ENV uv sync --dev
|
|
197
|
+
env -u VIRTUAL_ENV uv run --dev pytest
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
See the [development guide](AGENTS.md), [test guide](tests/TESTS.md),
|
|
201
|
+
[runtime architecture](docs/RUNTIME.md) and [workspace API](docs/WORKSPACE_API.md).
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# pycodex
|
|
2
|
+
|
|
3
|
+
[中文](README_ZH.md)
|
|
4
|
+
|
|
5
|
+
pycodex is a Python implementation of the [Codex](https://github.com/openai/codex)
|
|
6
|
+
coding agent. Use it in a terminal, in a browser, or from your own Python code.
|
|
7
|
+
It supports file editing, command execution, multiple agents and saved sessions.
|
|
8
|
+
See [upstream alignment](docs/ALIGNMENT.md) for the supported scope and differences.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
| Package | Includes | Python |
|
|
13
|
+
| --- | --- | --- |
|
|
14
|
+
| `python-codex` | CLI and Python API | 3.6.2+ |
|
|
15
|
+
| `pycodex-ws` | Core plus browser workspace and optional Feishu integration | 3.7+ |
|
|
16
|
+
|
|
17
|
+
For the CLI and Python API:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
python3 -m pip install --upgrade python-codex
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
For the browser workspace, install `pycodex-ws`; it includes the matching core version:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
python3 -m pip install --upgrade pycodex-ws
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Configure a model
|
|
30
|
+
|
|
31
|
+
Create `~/.codex/config.toml`. For example, with OpenAI:
|
|
32
|
+
|
|
33
|
+
```toml
|
|
34
|
+
model = "gpt-5.4"
|
|
35
|
+
model_provider = "openai"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Supply the API key through the environment or `~/.codex/.env`:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
export OPENAI_API_KEY="your-api-key"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
For another provider, configure its `base_url` and `env_key`. Select the API with
|
|
45
|
+
`compat_api` in the profile or provider table:
|
|
46
|
+
|
|
47
|
+
| `compat_api` | API |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| `"none"` (default) | Responses |
|
|
50
|
+
| `"chat_completions"` | Chat Completions, including Step |
|
|
51
|
+
| `"messages"` | Claude Messages |
|
|
52
|
+
| `"gemini"` | Gemini API |
|
|
53
|
+
|
|
54
|
+
Legacy `use_chat_completion = true/false` remains supported as `chat_completions/none`.
|
|
55
|
+
|
|
56
|
+
Use `--profile NAME` to select `NAME.config.toml` beside the base config or an
|
|
57
|
+
embedded `[profiles.NAME]` table. Use `--config PATH` for a different config file,
|
|
58
|
+
and `pycodex doctor` to check configuration and connectivity.
|
|
59
|
+
The browser workspace picks up profile changes for new sessions without a restart.
|
|
60
|
+
|
|
61
|
+
See [configuration](docs/CONTEXT.md#配置读取与-profile) and the
|
|
62
|
+
[Gemini setup example](docs/responses_server/README.md#gemini-api).
|
|
63
|
+
Gemini 4 Argon includes a prompt adapted from Antigravity.
|
|
64
|
+
Gemini tool arguments stream as they are generated; tools run after the complete call is received.
|
|
65
|
+
|
|
66
|
+
## Use the CLI
|
|
67
|
+
|
|
68
|
+
Run these commands from your project directory:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pycodex
|
|
72
|
+
pycodex "Summarize this repository."
|
|
73
|
+
pycodex --profile my_profile "Review the latest changes."
|
|
74
|
+
pycodex --json "Summarize this repository."
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The first command starts an interactive session; the others run a single task.
|
|
78
|
+
The agent can edit files and run commands with your user account's permissions.
|
|
79
|
+
|
|
80
|
+
| Command | Purpose |
|
|
81
|
+
| --- | --- |
|
|
82
|
+
| `/model`, `/effort` | View or change the model and reasoning effort |
|
|
83
|
+
| `/cd <directory>` | Change directory while idle |
|
|
84
|
+
| `/title`, `/history` | Manage the title and inspect conversation history |
|
|
85
|
+
| `/resume` | List or resume saved sessions |
|
|
86
|
+
| `/compact` | Summarize history to free context |
|
|
87
|
+
| `/queue <message>` | Submit a task after the current one finishes |
|
|
88
|
+
|
|
89
|
+
Send a message while the agent is working to redirect it, or use `/queue` to
|
|
90
|
+
wait. Sessions are saved under `~/.codex/sessions` by default.
|
|
91
|
+
Ctrl+C or Ctrl+D closes the session after issued operations finish.
|
|
92
|
+
Run `pycodex --help` for all options.
|
|
93
|
+
|
|
94
|
+
For a local vLLM server:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pycodex --vllm-endpoint http://127.0.0.1:18000
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Use the browser workspace
|
|
101
|
+
|
|
102
|
+
After installing `pycodex-ws`, create `workspaces.json`:
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"workspaces": [
|
|
107
|
+
{"id": "demo", "work_dir": ".", "state_path": "demo", "enable_board": true}
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Start the server and keep the terminal open:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
pycodex-ws --listen 127.0.0.1:6007 --workspace-config workspaces.json
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Open `http://127.0.0.1:6007`. The workspace uses the same model configuration as
|
|
119
|
+
the CLI and provides conversations, a live HTML Canvas, and file/diff viewers.
|
|
120
|
+
Click file links to inspect code, then select text and use **Insert into chat**
|
|
121
|
+
to include it in your next message.
|
|
122
|
+
|
|
123
|
+
The settings menu provides interface customization and password-protected
|
|
124
|
+
workspace sharing. See the [workspace guide](packages/pycodex-ws/README.md) for
|
|
125
|
+
session controls, storage and Feishu setup. A separate
|
|
126
|
+
[VS Code extension](packages/pycodex-ws/extensions/vscode/README.md) connects to
|
|
127
|
+
the same backend, including over Remote SSH.
|
|
128
|
+
|
|
129
|
+
## Use the Python API
|
|
130
|
+
|
|
131
|
+
Save this as `example.py` and run `python3 example.py`. It uses the model
|
|
132
|
+
configuration above and the standard tools:
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
from contextlib import closing
|
|
136
|
+
|
|
137
|
+
from pycodex import AgentsManager, CodexConfig
|
|
138
|
+
from pycodex.bootstrap import build_model
|
|
139
|
+
from pycodex.utils.async_bridge import run_async
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
async def main():
|
|
143
|
+
config = CodexConfig.from_env()
|
|
144
|
+
with closing(build_model(config.provider)) as model:
|
|
145
|
+
runtime = AgentsManager(
|
|
146
|
+
model.client, config.context,
|
|
147
|
+
).create_root_runtime()
|
|
148
|
+
try:
|
|
149
|
+
await runtime.start()
|
|
150
|
+
receipt = await runtime.submit_input("Summarize this repository.")
|
|
151
|
+
print((await receipt.future).output_text)
|
|
152
|
+
finally:
|
|
153
|
+
await runtime.close()
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
run_async(main())
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
`AgentsManager` creates the runtime; `submit_input` submits work.
|
|
160
|
+
Await `receipt.future` for the result. The example closes the runtime and any
|
|
161
|
+
local compatibility server when finished. See [runtime contracts](docs/RUNTIME.md#ownership) for
|
|
162
|
+
custom models, tools and integrations.
|
|
163
|
+
|
|
164
|
+
## More features
|
|
165
|
+
|
|
166
|
+
- [Portable configuration](docs/PORTABLE.md): transfer encrypted configuration, instructions and skills to another machine.
|
|
167
|
+
- [Frontend customization](packages/pycodex-ws/README.md#customize-the-interface): change the workspace through an Agent conversation or your own CSS/JavaScript.
|
|
168
|
+
- [Responses compatibility server](docs/responses_server/README.md): expose a supported backend through the Responses API.
|
|
169
|
+
- [Retries and fallback models](docs/RUNTIME.md#responses-reliability): configure recovery from model failures.
|
|
170
|
+
|
|
171
|
+
## Development
|
|
172
|
+
|
|
173
|
+
From the repository root:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
env -u VIRTUAL_ENV uv sync --dev
|
|
177
|
+
env -u VIRTUAL_ENV uv run --dev pytest
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
See the [development guide](AGENTS.md), [test guide](tests/TESTS.md),
|
|
181
|
+
[runtime architecture](docs/RUNTIME.md) and [workspace API](docs/WORKSPACE_API.md).
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# pycodex
|
|
2
|
+
|
|
3
|
+
[English](README.md)
|
|
4
|
+
|
|
5
|
+
pycodex 用 Python 实现 [Codex](https://github.com/openai/codex) 编程 Agent,
|
|
6
|
+
可在终端、浏览器或自己的 Python 程序中使用,支持文件编辑、命令执行、
|
|
7
|
+
多 Agent 协作和会话恢复。支持范围及与上游的差异见[对齐文档](docs/ALIGNMENT.md)。
|
|
8
|
+
|
|
9
|
+
## 安装
|
|
10
|
+
|
|
11
|
+
| 包 | 内容 | Python |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| `python-codex` | CLI 和 Python API | 3.6.2+ |
|
|
14
|
+
| `pycodex-ws` | Core、浏览器工作区和可选飞书集成 | 3.7+ |
|
|
15
|
+
|
|
16
|
+
使用 CLI 或 Python API:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
python3 -m pip install --upgrade python-codex
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
使用浏览器工作区则安装 `pycodex-ws`,它会同时安装匹配版本的 core:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
python3 -m pip install --upgrade pycodex-ws
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## 配置模型
|
|
29
|
+
|
|
30
|
+
创建 `~/.codex/config.toml`。以 OpenAI 为例:
|
|
31
|
+
|
|
32
|
+
```toml
|
|
33
|
+
model = "gpt-5.4"
|
|
34
|
+
model_provider = "openai"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
API key 通过环境变量或 `~/.codex/.env` 提供:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
export OPENAI_API_KEY="your-api-key"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
其他 provider 需要配置 `base_url` 和 `env_key`,并在 profile 或 provider 中
|
|
44
|
+
用 `compat_api` 选择接口:
|
|
45
|
+
|
|
46
|
+
| `compat_api` | 接口 |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| `"none"`(默认) | Responses |
|
|
49
|
+
| `"chat_completions"` | Chat Completions,包括 Step |
|
|
50
|
+
| `"messages"` | Claude Messages |
|
|
51
|
+
| `"gemini"` | Gemini API |
|
|
52
|
+
|
|
53
|
+
旧配置 `use_chat_completion = true/false` 仍可用,分别对应 `chat_completions/none`。
|
|
54
|
+
|
|
55
|
+
用 `--profile NAME` 选择同目录的 `NAME.config.toml` 或内嵌的 `[profiles.NAME]`;
|
|
56
|
+
用 `--config PATH` 指定其他配置文件。`pycodex doctor` 可检查配置和连接。
|
|
57
|
+
浏览器工作区会为新会话动态读取 profile,修改配置后无需重启。
|
|
58
|
+
|
|
59
|
+
详见[配置文档](docs/CONTEXT.md#配置读取与-profile)和
|
|
60
|
+
[Gemini 配置示例](docs/responses_server/README.md#gemini-api)。
|
|
61
|
+
Gemini 4 Argon 内置基于 Antigravity 适配的提示词。
|
|
62
|
+
Gemini 工具参数支持流式接收,完整调用收到后再执行工具。
|
|
63
|
+
|
|
64
|
+
## 使用 CLI
|
|
65
|
+
|
|
66
|
+
在项目目录中运行:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pycodex
|
|
70
|
+
pycodex "概括这个仓库。"
|
|
71
|
+
pycodex --profile my_profile "审查最近的改动。"
|
|
72
|
+
pycodex --json "概括这个仓库。"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
不带问题时进入交互会话,其他命令执行单次任务。
|
|
76
|
+
Agent 可以修改文件、执行命令,使用当前用户的系统权限。
|
|
77
|
+
|
|
78
|
+
| 命令 | 用途 |
|
|
79
|
+
| --- | --- |
|
|
80
|
+
| `/model`、`/effort` | 查看或切换模型及推理强度 |
|
|
81
|
+
| `/cd <directory>` | 空闲时切换目录 |
|
|
82
|
+
| `/title`、`/history` | 管理标题、查看历史 |
|
|
83
|
+
| `/resume` | 列出或恢复已保存会话 |
|
|
84
|
+
| `/compact` | 压缩历史,释放上下文 |
|
|
85
|
+
| `/queue <message>` | 等当前任务完成后再执行 |
|
|
86
|
+
|
|
87
|
+
Agent 工作时可直接发送消息调整方向,或用 `/queue` 排队。
|
|
88
|
+
会话默认保存在 `~/.codex/sessions`。
|
|
89
|
+
Ctrl+C 或 Ctrl+D 会在已发出的操作完成后退出。完整选项见 `pycodex --help`。
|
|
90
|
+
|
|
91
|
+
接入本地 vLLM 服务:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
pycodex --vllm-endpoint http://127.0.0.1:18000
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## 使用浏览器工作区
|
|
98
|
+
|
|
99
|
+
安装 `pycodex-ws` 后,创建 `workspaces.json`:
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"workspaces": [
|
|
104
|
+
{"id": "demo", "work_dir": ".", "state_path": "demo", "enable_board": true}
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
启动服务并保持终端打开:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
pycodex-ws --listen 127.0.0.1:6007 --workspace-config workspaces.json
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
访问 `http://127.0.0.1:6007`。工作区沿用 CLI 的模型配置,提供对话、
|
|
116
|
+
实时 HTML Canvas 和文件/diff 查看器。点击文件链接查看代码,选中文字后
|
|
117
|
+
用 **Insert into chat** 加入下一条消息。
|
|
118
|
+
|
|
119
|
+
设置菜单支持界面定制和带密码的工作区分享。会话操作、存储和飞书配置见
|
|
120
|
+
[工作区指南](packages/pycodex-ws/README.md)。
|
|
121
|
+
独立安装的 [VS Code 扩展](packages/pycodex-ws/extensions/vscode/README.md)
|
|
122
|
+
可连接同一后端,也支持 Remote SSH。
|
|
123
|
+
|
|
124
|
+
## 使用 Python API
|
|
125
|
+
|
|
126
|
+
将以下代码保存为 `example.py`,运行 `python3 example.py`。
|
|
127
|
+
它会使用前面的模型配置和内置工具:
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
from contextlib import closing
|
|
131
|
+
|
|
132
|
+
from pycodex import AgentsManager, CodexConfig
|
|
133
|
+
from pycodex.bootstrap import build_model
|
|
134
|
+
from pycodex.utils.async_bridge import run_async
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
async def main():
|
|
138
|
+
config = CodexConfig.from_env()
|
|
139
|
+
with closing(build_model(config.provider)) as model:
|
|
140
|
+
runtime = AgentsManager(
|
|
141
|
+
model.client, config.context,
|
|
142
|
+
).create_root_runtime()
|
|
143
|
+
try:
|
|
144
|
+
await runtime.start()
|
|
145
|
+
receipt = await runtime.submit_input("概括这个仓库。")
|
|
146
|
+
print((await receipt.future).output_text)
|
|
147
|
+
finally:
|
|
148
|
+
await runtime.close()
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
run_async(main())
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
`AgentsManager` 创建 runtime,`submit_input` 提交任务,等待 `receipt.future` 获取结果。
|
|
155
|
+
示例结束时会关闭 runtime 和本地兼容服务。
|
|
156
|
+
自定义模型、工具与集成方式见[运行时文档](docs/RUNTIME.md#ownership)。
|
|
157
|
+
|
|
158
|
+
## 更多功能
|
|
159
|
+
|
|
160
|
+
- [Portable 配置](docs/PORTABLE.md):将配置、指令和 skills 加密迁移到其他机器。
|
|
161
|
+
- [界面定制](packages/pycodex-ws/README.md#customize-the-interface):通过 Agent 对话或 CSS/JavaScript 修改工作区。
|
|
162
|
+
- [Responses 兼容服务](docs/responses_server/README.md):通过 Responses API 接入支持的模型后端。
|
|
163
|
+
- [重试与备用模型](docs/RUNTIME.md#responses-reliability):配置模型故障后的恢复策略。
|
|
164
|
+
|
|
165
|
+
## 开发
|
|
166
|
+
|
|
167
|
+
在仓库根目录运行:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
env -u VIRTUAL_ENV uv sync --dev
|
|
171
|
+
env -u VIRTUAL_ENV uv run --dev pytest
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
参考[开发约定](AGENTS.md)、[测试指南](tests/TESTS.md)、
|
|
175
|
+
[运行时架构](docs/RUNTIME.md)和[工作区 API](docs/WORKSPACE_API.md)。
|
|
@@ -42,7 +42,6 @@ from .tools import (
|
|
|
42
42
|
ApplyPatchTool,
|
|
43
43
|
BaseTool,
|
|
44
44
|
ClockManager,
|
|
45
|
-
ClockTool,
|
|
46
45
|
CodeModeManager,
|
|
47
46
|
ExecCommandTool,
|
|
48
47
|
ExecTool,
|
|
@@ -54,10 +53,11 @@ from .tools import (
|
|
|
54
53
|
ReadFileTool,
|
|
55
54
|
Registry,
|
|
56
55
|
RequestPermissionsTool,
|
|
57
|
-
RequestUserInputTool,
|
|
58
56
|
SendMessageTool,
|
|
57
|
+
SetPeriodTool,
|
|
59
58
|
ShellCommandTool,
|
|
60
59
|
ShellTool,
|
|
60
|
+
SleepTool,
|
|
61
61
|
SpawnAgentTool,
|
|
62
62
|
ToolContext,
|
|
63
63
|
ToolRegistry,
|
|
@@ -84,7 +84,6 @@ __all__ = [
|
|
|
84
84
|
"AssistantMessage",
|
|
85
85
|
"BaseTool",
|
|
86
86
|
"ClockManager",
|
|
87
|
-
"ClockTool",
|
|
88
87
|
"create_agent_runtime_environment",
|
|
89
88
|
"CodeModeManager",
|
|
90
89
|
"CodexConfig",
|
|
@@ -105,7 +104,6 @@ __all__ = [
|
|
|
105
104
|
"Registry",
|
|
106
105
|
"ReadFileTool",
|
|
107
106
|
"RequestPermissionsTool",
|
|
108
|
-
"RequestUserInputTool",
|
|
109
107
|
"ModelResponse",
|
|
110
108
|
"ModelEvent",
|
|
111
109
|
"PlanStore",
|
|
@@ -118,8 +116,10 @@ __all__ = [
|
|
|
118
116
|
"ResponsesModelClient",
|
|
119
117
|
"ResponsesProviderConfig",
|
|
120
118
|
"SendMessageTool",
|
|
119
|
+
"SetPeriodTool",
|
|
121
120
|
"ShellCommandTool",
|
|
122
121
|
"ShellTool",
|
|
122
|
+
"SleepTool",
|
|
123
123
|
"SpawnAgentTool",
|
|
124
124
|
"ToolCall",
|
|
125
125
|
"ToolContext",
|
|
@@ -90,20 +90,18 @@ def build_model(
|
|
|
90
90
|
timeout_seconds: "float" = 120.0,
|
|
91
91
|
managed_responses_base_url: "typing.Union[str, None]" = None,
|
|
92
92
|
vllm_endpoint: "typing.Union[str, None]" = None,
|
|
93
|
-
use_chat_completion: "typing.Union[bool, None]" = None,
|
|
94
|
-
use_messages: "bool" = False,
|
|
95
93
|
) -> "ModelBootstrapResult":
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
94
|
+
compat_api = provider_config.compat_api
|
|
95
|
+
if vllm_endpoint is not None and compat_api not in ("none", "chat_completions"):
|
|
96
|
+
raise ValueError("--vllm-endpoint cannot be combined with compat_api=" + compat_api)
|
|
97
|
+
if managed_responses_base_url is not None and (
|
|
98
|
+
vllm_endpoint is not None or compat_api != "none"
|
|
99
|
+
):
|
|
100
|
+
raise ValueError("a managed Responses endpoint cannot be combined with compat_api or --vllm-endpoint")
|
|
102
101
|
uses_local_responses_compat = (
|
|
103
102
|
managed_responses_base_url is not None
|
|
104
103
|
or vllm_endpoint is not None
|
|
105
|
-
or
|
|
106
|
-
or use_messages
|
|
104
|
+
or compat_api != "none"
|
|
107
105
|
)
|
|
108
106
|
if vllm_endpoint is not None:
|
|
109
107
|
provider_config = replace(
|
|
@@ -122,7 +120,7 @@ def build_model(
|
|
|
122
120
|
LOCAL_RESPONSES_SERVER_API_KEY_ENV,
|
|
123
121
|
)
|
|
124
122
|
os.environ.setdefault(LOCAL_RESPONSES_SERVER_API_KEY_ENV, "dummy")
|
|
125
|
-
elif vllm_endpoint
|
|
123
|
+
elif vllm_endpoint is not None or compat_api != "none":
|
|
126
124
|
if vllm_endpoint:
|
|
127
125
|
managed_server = launch_chat_completion_compat_server(
|
|
128
126
|
vllm_endpoint,
|
|
@@ -133,7 +131,7 @@ def build_model(
|
|
|
133
131
|
provider_config.base_url,
|
|
134
132
|
provider_config.api_key_env,
|
|
135
133
|
model_provider=provider_config.provider_name,
|
|
136
|
-
outcomming_api=
|
|
134
|
+
outcomming_api=compat_api,
|
|
137
135
|
)
|
|
138
136
|
url, key_env = (
|
|
139
137
|
managed_server.base_url,
|
|
@@ -62,18 +62,6 @@ def build_parser():
|
|
|
62
62
|
default=None,
|
|
63
63
|
help="Start a local responses compat server for a chat-completions-backed vLLM endpoint.",
|
|
64
64
|
)
|
|
65
|
-
parser.add_argument(
|
|
66
|
-
"--use-chat-completion",
|
|
67
|
-
default=False,
|
|
68
|
-
action="store_true",
|
|
69
|
-
help="Start a local responses compat server for this session.",
|
|
70
|
-
)
|
|
71
|
-
parser.add_argument(
|
|
72
|
-
"--use-messages",
|
|
73
|
-
default=False,
|
|
74
|
-
action="store_true",
|
|
75
|
-
help="Route the local responses compat server to a downstream /v1/messages backend.",
|
|
76
|
-
)
|
|
77
65
|
parser.add_argument(
|
|
78
66
|
"--system-prompt",
|
|
79
67
|
default=None,
|
|
@@ -150,8 +138,6 @@ async def run_cli(args):
|
|
|
150
138
|
config.provider,
|
|
151
139
|
timeout_seconds=args.timeout_seconds,
|
|
152
140
|
vllm_endpoint=args.vllm_endpoint,
|
|
153
|
-
use_chat_completion=args.use_chat_completion or None,
|
|
154
|
-
use_messages=args.use_messages,
|
|
155
141
|
)
|
|
156
142
|
if bootstrap.owned_server is not None:
|
|
157
143
|
atexit.register(bootstrap.owned_server.stop)
|