64bit / async-openai

Rust library for OpenAI
https://docs.rs/async-openai
MIT License
1.09k stars 161 forks source link

Usage of std::thread::sleep inside async function in assistants example #194

Closed sgopalan98 closed 5 months ago

sgopalan98 commented 6 months ago

In this line in the assistants example, you are using std::thread::sleep - this would block the whole async runtime

64bit commented 6 months ago

Thanks for the issue - PR is welcome for the fix!

This is community contributed example perhaps early in their Rust journey, but yes tokio::time::sleep would be better.