You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import asyncio
from g4f.client import AsyncClient
from g4f.Provider import BingCreateImages, OpenaiChat, Gemini
async def main():
client = AsyncClient(
provider=OpenaiChat,
image_provider=Gemini,
)
task1 = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[{"role": "user", "content": "Say this is a test"}],
)
task2 = client.images.generate(
model="dall-e-3",
prompt="a white siamese cat",
)
responses = await asyncio.gather(task1, task2)
print(responses)
asyncio.run(main())
when run this code i see a error:
Traceback (most recent call last):
File "C:\gpt4\chat.py", line 20, in <module>
asyncio.run(main())
File "C:\Users\Gigabyte\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Users\Gigabyte\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Gigabyte\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\gpt4\chat.py", line 16, in main
responses = await asyncio.gather(task1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\gpt4\g4f\client\async_client.py", line 63, in iter_append_model_and_provider
async for chunk in response:
File "C:\gpt4\g4f\client\async_client.py", line 37, in iter_response
async for chunk in response:
File "C:\gpt4\g4f\Provider\needs_auth\OpenaiChat.py", line 421, in create_async_generator
blob = data["arkose"]["dx"]
~~~~~~~~~~~~~~^^^^^^
KeyError: 'dx'
how to fix bug?
The text was updated successfully, but these errors were encountered:
this is my code:
when run this code i see a error:
how to fix bug?
The text was updated successfully, but these errors were encountered: