Skip to content

ait: update python token streamin async patterns#3269

Merged
owenpearson merged 1 commit intomainfrom
python-token-streaming-async-patterns
Mar 16, 2026
Merged

ait: update python token streamin async patterns#3269
owenpearson merged 1 commit intomainfrom
python-token-streaming-async-patterns

Conversation

@owenpearson
Copy link
Member

@owenpearson owenpearson commented Mar 12, 2026

Fixes bugs with asyncio/coroutine usage in python examples in the AIT docs where coroutines were created but never actually started. this meant that in some cases coroutines were created and then all executed at once using asyncio.gather, and in some cases coroutines weren't started at all. the most common way to create a coroutine and start it immediately is by wrapping the coroutine in a call to asyncio.create_task, so this PR updates all AIT python examples to do that.

I've tested the new examples with standalone python scripts and verified that they work correctly.

AIT-550

@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: bb0c913d-8179-4556-9380-b76014a1911c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch python-token-streaming-async-patterns
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can scan for known vulnerabilities in your dependencies using OSV Scanner.

OSV Scanner will automatically detect and report security vulnerabilities in your project's dependencies. No additional configuration is required.

@owenpearson owenpearson force-pushed the python-token-streaming-async-patterns branch from f9e5541 to 7f44e1a Compare March 12, 2026 11:21
@owenpearson owenpearson requested review from GregHolmes and ttypic and removed request for GregHolmes March 12, 2026 11:41
@owenpearson owenpearson marked this pull request as ready for review March 12, 2026 11:41
Copy link
Contributor

@ttypic ttypic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@owenpearson owenpearson force-pushed the python-token-streaming-async-patterns branch from 7f44e1a to 5ae194e Compare March 16, 2026 12:33
@owenpearson owenpearson enabled auto-merge March 16, 2026 12:33
@owenpearson owenpearson merged commit 6326ef6 into main Mar 16, 2026
6 of 7 checks passed
@owenpearson owenpearson deleted the python-token-streaming-async-patterns branch March 16, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants