Skip to content

Commit 79a1999

Browse files
authored
Make docs and comments more consistent using Codex (#391)
1 parent 03ebbaa commit 79a1999

File tree

15 files changed

+70
-70
lines changed

15 files changed

+70
-70
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@openai/agents-core": patch
3+
"@openai/agents-realtime": patch
4+
"@openai/agents": patch
5+
---
6+
7+
Make docs and comments more consistent using Codex

AGENTS.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This guide helps new contributors get started with the OpenAI Agents JS monorepo
1515
7. [Pull Request & Commit Guidelines](#pull-request--commit-guidelines)
1616
8. [Review Process & What Reviewers Look For](#review-process--what-reviewers-look-for)
1717
9. [Tips for Navigating the Repo](#tips-for-navigating-the-repo)
18+
10. [Prerequisites](#prerequisites)
1819

1920
## Overview
2021

@@ -27,15 +28,15 @@ The OpenAI Agents JS repository is a pnpm-managed monorepo that provides:
2728
- `packages/agents-extensions`: Extensions for agent workflows.
2829
- `docs`: Documentation site powered by Astro.
2930
- `examples`: Sample projects demonstrating usage patterns.
30-
- `scripts`: Automation scripts (`dev.ts`, `embedMeta.ts`).
31+
- `scripts`: Automation scripts (`dev.mts`, `embedMeta.ts`).
3132
- `helpers`: Shared utilities for testing and other internal use.
3233

3334
## Repo Structure & Important Files
3435

3536
- `packages/agents-core/`, `packages/agents-openai/`, `packages/agents-realtime/`, `packages/agents-extensions/`: Each has its own `package.json`, `src/`, `test/`, and build scripts.
36-
- `docs/`: Documentation source; run with `pnpm docs:dev` or build with `pnpm -F docs build`.
37+
- `docs/`: Documentation source; develop with `pnpm docs:dev` or build with `pnpm docs:build`.
3738
- `examples/`: Subdirectories (e.g. `basic`, `agent-patterns`) with their own `package.json` and start scripts.
38-
- `scripts/dev.ts`: Runs concurrent build-watchers and the docs dev server (`pnpm dev`).
39+
- `scripts/dev.mts`: Runs concurrent build-watchers and the docs dev server (`pnpm dev`).
3940
- `scripts/embedMeta.ts`: Generates `src/metadata.ts` for each package before build.
4041
- `helpers/tests/`: Shared test utilities.
4142
- `README.md`: High-level overview and installation instructions.
@@ -50,7 +51,7 @@ The OpenAI Agents JS repository is a pnpm-managed monorepo that provides:
5051

5152
Before submitting changes, ensure all checks pass:
5253

53-
### Unit Tests and Type Checking Examples
54+
### Unit Tests and Type Checking
5455

5556
- Check the compilation across all packages and examples:
5657
```bash
@@ -61,11 +62,19 @@ Before submitting changes, ensure all checks pass:
6162
CI=1 pnpm test
6263
```
6364
- Tests are located under each package in `packages/<pkg>/test/`.
64-
- Using `CI=1` makes sure that the tests don't automatically run in watch mode
65+
- The test script already sets `CI=1` to avoid watch mode.
6566

6667
### Integration Tests
6768

68-
- Do NOT try to run them. Integration tests currently require a valid OpenAI Account.
69+
- Not required for typical contributions. These tests rely on a local npm registry (Verdaccio) and other environment setup.
70+
- To run locally only if needed:
71+
```bash
72+
pnpm local-npm:start # starts Verdaccio on :4873
73+
pnpm local-npm:publish # public pacakges to the local repo
74+
pnpm test:integration # runs integration tests
75+
```
76+
77+
See [this README](integration-tests/README.md) for details.
6978

7079
### Code Coverage
7180

@@ -106,7 +115,7 @@ Before submitting changes, ensure all checks pass:
106115
- Documentation site:
107116
```bash
108117
pnpm docs:dev
109-
pnpm -F docs build
118+
pnpm docs:build
110119
```
111120
- Examples:
112121
```bash
@@ -132,6 +141,11 @@ Before submitting changes, ensure all checks pass:
132141
- Run `pnpm lint` and fix all errors locally.
133142
- Use `pnpm build` to catch type errors.
134143

144+
## Prerequisites
145+
146+
- Node.js 22+ recommended.
147+
- pnpm 10+ (`corepack enable` is recommended to manage versions).
148+
135149
## Development Workflow
136150

137151
1. Sync with `main` (or default branch).
@@ -160,7 +174,8 @@ Before submitting changes, ensure all checks pass:
160174
- `build`: changes that affect the build system
161175
- `ci`: CI configuration
162176
- `style`: code style (formatting, missing semicolons, etc.)
163-
- `TYP`: type-related changes
177+
- `types`: type-related changes
178+
- `revert`: reverts a previous commit
164179
- Commit message format:
165180

166181
```
@@ -191,4 +206,4 @@ Before submitting changes, ensure all checks pass:
191206
- Study `vitest.config.ts` for test patterns (e.g., setup files, aliasing).
192207
- Explore `scripts/embedMeta.ts` for metadata generation logic.
193208
- Examples in `examples/` are fully functional apps—run them to understand usage.
194-
- Docs in `docs/src/` use Astro and Starlight; pages mirror package APIs under `docs/src/openai/agents`.
209+
- Docs in `docs/src/` use Astro and Starlight; authored content lives under `docs/src/content/docs/` and mirrors package APIs.

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Explore the [`examples/`](examples/) directory to see the SDK in action.
3030
- [x] **Guardrails**: Input and output validation for safety and reliability.
3131
- [x] **Parallelization**: Run agents or tool calls in parallel and aggregate results.
3232
- [x] **Human-in-the-Loop**: Integrate human approval or intervention into workflows.
33-
- [x] **Realtime Voice Agents**: Build realtime voice agents using WebRTC or Websockets
33+
- [x] **Realtime Voice Agents**: Build realtime voice agents using WebRTC or WebSockets
3434
- [x] **Local MCP Server Support**: Give an Agent access to a locally running MCP server to provide tools
3535
- [x] **Separate optimized browser package**: Dedicated package meant to run in the browser for Realtime agents.
3636
- [x] **Broader model support**: Use non-OpenAI models through the Vercel AI SDK adapter
@@ -166,11 +166,11 @@ const agent = new RealtimeAgent({
166166
tools: [getWeatherTool],
167167
});
168168

169-
// Intended to be run the browser
170-
const { apiKey } = await fetch('/path/to/ephemerial/key/generation').then(
169+
// Intended to run in the browser
170+
const { apiKey } = await fetch('/path/to/ephemeral/key/generation').then(
171171
(resp) => resp.json(),
172172
);
173-
// automatically configures audio input/output so start talking
173+
// Automatically configures audio input/output start talking
174174
const session = new RealtimeSession(agent);
175175
await session.connect({ apiKey });
176176
```
@@ -181,8 +181,8 @@ The [`examples/`](examples/) directory contains a series of examples to get star
181181

182182
- `pnpm examples:basic` - Basic example with handoffs and tool calling
183183
- `pnpm examples:agents-as-tools` - Using agents as tools for translation
184-
- `pnpm examples:web-search` - Using the web search tool
185-
- `pnpm examples:file-search` - Using the file search tool
184+
- `pnpm examples:tools-web-search` - Using the web search tool
185+
- `pnpm examples:tools-file-search` - Using the file search tool
186186
- `pnpm examples:deterministic` - Deterministic multi-agent workflow
187187
- `pnpm examples:parallelization` - Running agents in parallel and picking the best result
188188
- `pnpm examples:human-in-the-loop` - Human approval for certain tool calls
@@ -244,10 +244,16 @@ If you want to contribute or edit the SDK/examples:
244244
2. Build the project
245245

246246
```bash
247-
pnpm build
247+
pnpm build && pnpm -r build-check
248248
```
249249

250-
3. Run tests, linter, etc. (add commands as appropriate for your project)
250+
3. Run tests and linter
251+
252+
```bash
253+
pnpm test && pnpm lint
254+
```
255+
256+
See `AGENTS.md` and `CONTRIBUTING.md` for the full contributor guide.
251257

252258
## Acknowledgements
253259

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ pnpm docs:translate
2323
The docs are automatically built and deployed using GitHub Actions. To build them locally run:
2424

2525
```bash
26-
pnpm -F docs build
26+
pnpm docs:build
2727
```

docs/src/content/docs/guides/agents.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Supplying tools doesn’t guarantee the LLM will call one. You can **force** too
147147

148148
After a tool call the SDK automatically resets `tool_choice` back to `'auto'`. This prevents
149149
the model from entering an infinite loop where it repeatedly tries to call the tool. You can
150-
override this behaviour via the `resetToolChoice` flag or by configuring
150+
override this behavior via the `resetToolChoice` flag or by configuring
151151
`toolUseBehavior`:
152152

153153
- `'run_llm_again'` (default) – run the LLM again with the tool result.

docs/src/content/docs/guides/config.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Configuring the SDK
3-
description: Customize API keys, tracing and logging behaviour
3+
description: Customize API keys, tracing and logging behavior
44
---
55

66
import { Code } from '@astrojs/starlight/components';

docs/src/content/docs/guides/tools.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ See [`filesystem-example.ts`](https://github.com/openai/openai-agents-js/tree/ma
9999

100100
---
101101

102-
## Tool use behaviour
102+
## Tool use behavior
103103

104104
Refer to the [Agents guide](/openai-agents-js/guides/agents#forcing-tool-use) for controlling when and how a model
105105
must use tools (`tool_choice`, `toolUseBehavior`, etc.).

docs/src/content/docs/guides/voice-agents/quickstart.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import thinClientExample from '../../../../../../examples/docs/voice-agents/thin
4444

4545
2. **Generate a client ephemeral token**
4646

47-
As this application will run in the users browser, we need a secure way to connect to the model through the Realtime API. For this we can use a [ephemeral client key](https://platform.openai.com/docs/guides/realtime#creating-an-ephemeral-token) that should get generated on your backend server. For testing purposes you can also generate a key using `curl` and your regular OpenAI API key.
47+
As this application will run in the user's browser, we need a secure way to connect to the model through the Realtime API. For this we can use an [ephemeral client key](https://platform.openai.com/docs/guides/realtime#creating-an-ephemeral-token) that should be generated on your backend server. For testing purposes you can also generate a key using `curl` and your regular OpenAI API key.
4848

4949
```bash
5050
curl -X POST https://api.openai.com/v1/realtime/sessions \

docs/src/content/docs/ja/guides/config.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: SDK の設定
3-
description: Customize API keys, tracing and logging behaviour
3+
description: Customize API keys, tracing and logging behavior
44
---
55

66
import { Code } from '@astrojs/starlight/components';

examples/docs/readme/readme-voice-agent.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ const agent = new RealtimeAgent({
1717
});
1818

1919
async function main() {
20-
// Intended to be run the browser
21-
const { apiKey } = await fetch('/path/to/ephemerial/key/generation').then(
20+
// Intended to run in the browser
21+
const { apiKey } = await fetch('/path/to/ephemeral/key/generation').then(
2222
(resp) => resp.json(),
2323
);
24-
// automatically configures audio input/output so start talking
24+
// Automatically configures audio input/output start talking
2525
const session = new RealtimeSession(agent);
2626
await session.connect({ apiKey });
2727
}

0 commit comments

Comments
 (0)