gpt4free
gpt4free copied to clipboard
Bing provider mime type bug
response = g4f.ChatCompletion.create(
provider=g4f.Provider.Bing,
model="gpt-3.5-turbo",
messages=[{"role": "user", "content": "write me a javascript method that would make a text summation"}],
temperature=0.5,
max_tokens=2000,
top_p=1,
frequency_penalty=0,
presence_penalty=0,
n=1,
stop=["\nUser:"],
stream=True,
)
----- gpt3
Traceback (most recent call last):
File "/var/www/ai/ai/manage.py", line 22, in <module>
main()
File "/var/www/ai/ai/manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/var/www/ai/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
utility.execute()
File "/var/www/ai/lib/python3.11/site-packages/django/core/management/__init__.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/var/www/ai/lib/python3.11/site-packages/django/core/management/base.py", line 412, in run_from_argv
self.execute(*args, **cmd_options)
File "/var/www/ai/lib/python3.11/site-packages/django/core/management/base.py", line 458, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/ai/lib/python3.11/site-packages/django/core/management/commands/shell.py", line 127, in handle
exec(sys.stdin.read(), globals())
File "<string>", line 30, in <module>
File "/var/www/ai/lib/python3.11/site-packages/g4f/Provider/base_provider.py", line 109, in create_completion
yield loop.run_until_complete(gen.__anext__())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/var/www/ai/lib/python3.11/site-packages/g4f/Provider/Bing.py", line 236, in stream_generate
conversation = await create_conversation(session)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/ai/lib/python3.11/site-packages/g4f/Provider/Bing.py", line 57, in create_conversation
response = await response.json()
^^^^^^^^^^^^^^^^^^^^^
File "/var/www/ai/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1104, in json
raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://www.bing.com/turing/conversation/create')
With newest version 0.1.4.5
Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.