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

Hello World code sample in README.md is not properly awaited #5012

Closed
Programmer-RD-AI opened this issue Jan 12, 2025 · 0 comments · Fixed by #5013
Closed

Hello World code sample in README.md is not properly awaited #5012

Programmer-RD-AI opened this issue Jan 12, 2025 · 0 comments · Fixed by #5013

Comments

@Programmer-RD-AI
Copy link
Contributor

What happened?

The Hello World code sample provided in the README.md file of the repository does not properly await the asynchronous agent.run() method. This results in a RuntimeWarning and improper execution of the sample code.

<coroutine object BaseChatAgent.run at 0x75adf0cbb2e0>  
/home/ranuga/Jobs/Altrium/Altrium-PD/Learning/AutoGen/basic.py:7: RuntimeWarning: coroutine 'BaseChatAgent.run' was never awaited  
  print(agent.run(task="Say 'Hello World!'"))  
RuntimeWarning: Enable tracemalloc to get the object allocation traceback  

What did you expect to happen?

The code sample should execute correctly without raising a warning, and it should print the result of the task Say 'Hello World!'.

How can we reproduce it (as minimally and precisely as possible)?

  1. Clone the repository and follow the setup instructions in the README.md.
  2. Copy the Hello World code sample from the README.md.
  3. Run the code without modifying it.

AutoGen version

0.4.0

Which package was this bug in

Core

Model used

gpt-4o

Python version

3.11.7

Operating system

Ubuntu 24.04

Any additional info you think would be helpful for fixing this bug

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant