Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Properly await agent.run() in README Hello World example #5013

Merged
merged 3 commits into from
Jan 12, 2025

Conversation

Programmer-RD-AI
Copy link
Contributor

Updated Hello World Code Sample in README.md

  • Updated the Hello World code sample to use asyncio for proper coroutine handling.
  • Resolved the RuntimeWarning caused by not awaiting the agent.run() method.
  • Ensures the example executes correctly without errors or warnings.

Why Are These Changes Needed?

The Hello World example in the README.md file does not properly await the agent.run() method, leading to a RuntimeWarning. This fix ensures the example demonstrates correct usage of the library, providing a better experience for users following the documentation.

Related Issue Number

Closes #5012

Checks

- Updated the `Hello World` code sample to use `asyncio` for proper coroutine handling.
- Resolved `RuntimeWarning` caused by not awaiting the `agent.run()` method.
- Ensures the example executes correctly without errors or warnings.
Copy link
Collaborator

@ekzhu ekzhu left a comment

Choose a reason for hiding this comment

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

Thank you!

@ekzhu ekzhu enabled auto-merge (squash) January 12, 2025 08:22
@ekzhu ekzhu disabled auto-merge January 12, 2025 08:24
Copy link

codecov bot commented Jan 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.60%. Comparing base (9f351c5) to head (344afbd).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5013   +/-   ##
=======================================
  Coverage   68.60%   68.60%           
=======================================
  Files         156      156           
  Lines       10053    10053           
=======================================
  Hits         6897     6897           
  Misses       3156     3156           
Flag Coverage Δ
unittests 68.60% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ekzhu ekzhu enabled auto-merge (squash) January 12, 2025 09:01
@ekzhu ekzhu merged commit 5e2a69a into microsoft:main Jan 12, 2025
61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hello World code sample in README.md is not properly awaited
2 participants