Open gingerwizard opened 1 year ago
I will look into this either tomorrow or Friday. Thanks for the heads up!
You can try doing something like this => @rate_limiter.is_limited() async def call_openai(kwargs): print("Calling OpenAI API...") result = openai.ChatCompletion.create(kwargs) print("OpenAI API call completed.") return result
on inspecting the source code, the sync part of the Redis one isn't properly implemented, but the async one works, as in the aenter dunder that wait_for_capacity() function is properly called unlike the enter dunder.
This worked for me, hope this helps.
I'm running into the same issue, but I can't seem to get the async function to work.
Following (v0.3.0)
throws an exception