#320

docs: fix AsyncGenerator annotation in README example

Openjayfeng7wants to merge intofrom

The custom-agent example uses AsyncGenerator without importing it, which raises NameError when defining CustomAgent. Add the import and specify None as the send type so the annotation also evaluates on Python 3.12.

Validation:

  • Reproduced the missing-import error and the single-type-argument error, then successfully defined CustomAgent after the change on Python 3.12, without model/API calls.
  • Checked Markdown structure and git diff --check.
  • Passed uv run --no-sync ruff format --check src tests examples, uv run --no-sync ruff check src tests examples, uv run --no-sync mypy, and uv run --no-sync ty check (example dependencies installed locally).

Suggested changelog label: internal (documentation only).

Activity

3
vercel[bot]1mo ago

@jayfeng7 is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

jayfeng71mo ago

Friendly ping — this is a small README correction to the custom Agent example's AsyncGenerator annotation. The four security/automated-review checks passed. Correction to my earlier wording: CI and the changelog-label workflow still need maintainer approval, and the Vercel preview requires team authorization; these have not passed yet. Could a maintainer approve CI and apply the internal changelog label when convenient? Happy to adjust the example based on review.