Closed DarkReaperBoy closed 1 week ago
The service provider responded with error codes 500 and 402. Consider using an alternative provider other than Liaobots. Asynchronous and synchronous methods are mixed in g4f. If you use the uvloop package and not asyncio as a web server, you can no longer nest it. Mostly, a switch to the AsyncClient helps.
@hlohaus buuut gui works. so i'm certain it's an api specific issue. without blackbox param it says:
ERROR:g4f.api:RetryProvider failed:
Blackbox: RuntimeError: this event loop is already running.
Liaobots: RuntimeError: this event loop is already running.
Traceback (most recent call last):
File "/home/nako/.conda/lib/python3.12/site-packages/g4f/api/__init__.py", line 231, in streaming
async for chunk in response:
File "/home/nako/.conda/lib/python3.12/site-packages/g4f/client/__init__.py", line 163, in async_iter_append_model_and_provider
async for chunk in response:
File "/home/nako/.conda/lib/python3.12/site-packages/g4f/client/__init__.py", line 117, in async_iter_response
async for chunk in response:
File "/home/nako/.conda/lib/python3.12/site-packages/g4f/client/helper.py", line 55, in to_async_iterator
for item in iterator:
^^^^^^^^
File "/home/nako/.conda/lib/python3.12/site-packages/g4f/providers/retry_provider.py", line 68, in create_completion
raise_exceptions(exceptions)
File "/home/nako/.conda/lib/python3.12/site-packages/g4f/providers/retry_provider.py", line 324, in raise_exceptions
raise RetryProviderError("RetryProvider failed:\n" + "\n".join([
g4f.errors.RetryProviderError: RetryProvider failed:
Blackbox: RuntimeError: this event loop is already running.
Liaobots: RuntimeError: this event loop is already running.
also...
If you use the uvloop package and not asyncio as a web server, you can no longer nest it. Mostly, a switch to the AsyncClient helps.
no, i'm using regular
g4f api
so did
pip uninstall uvloop
and issue got solved. thanks!
here is the log.
command used to run (but it ain't provider issue):
without --provider would be:
thought maybe it's the app that is buggy, but happened same in multiple app. so i guess it's a gpt4free issue.