Skip to content

Commit 525208a

Browse files
committed
chore: improve docs + tests + examples
1 parent cb32104 commit 525208a

9 files changed

Lines changed: 1043 additions & 124 deletions

File tree

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,29 @@ Use `AppServerClient` when you want a deeper integration:
4444
## Quickstart: `Codex`
4545

4646
```python
47-
from codex import Codex
47+
from codex import Codex, ThreadStartOptions
4848

4949
client = Codex()
50+
51+
# Simplest one-shot call.
5052
summary = client.run_text("Diagnose the failing tests and propose a fix")
5153
print(summary)
54+
55+
# One-shot call with thread-scoped defaults for that run's fresh internal thread.
56+
summary = client.run_text(
57+
"Diagnose the failing tests in this repo",
58+
thread_options=ThreadStartOptions(
59+
cwd="/repo",
60+
model="gpt-5",
61+
),
62+
)
63+
print(summary)
5264
```
5365

66+
Use `thread_options=` on `run()`, `run_text()`, `run_json()`, and `run_model()` when you want to
67+
set defaults on the fresh internal thread created for that one-shot call. Use
68+
`start_thread()` / `resume_thread()` when later runs should share context.
69+
5470
More `Codex` examples: [docs/exec_api.md](docs/exec_api.md)
5571

5672
## Quickstart: `AppServerClient`

0 commit comments

Comments
 (0)