If I use "gpt-4" and "Aws" as the provider, then I tell the model to "Tell me an amazing story", I get this error:
Say: tell me an amazing story
Traceback (most recent call last):
File "C:\Users\lenovo\Documents\Projects\gpt4free-1\venv\Lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python311\Lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python311\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python311\Lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\Users\lenovo\Documents\Projects\gpt4free-1\main.py", line 7, in <module>
response = g4f.ChatCompletion.create(model='gpt-4', provider=g4f.Provider.Aws, messages=history)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\lenovo\Documents\Projects\gpt4free-1\g4f\__init__.py", line 48, in create
if stream else ''.join(engine._create_completion(model.name, messages, stream, **kwargs)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\lenovo\Documents\Projects\gpt4free-1\g4f\Provider\Providers\Aws.py", line 23, in _create_completion
yield (response.json()['choices'][0]['message']['content'])
^^^^^^^^^^^^^^^
File "C:\Users\lenovo\Documents\Projects\gpt4free-1\venv\Lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
EDIT: The response shows a 502 HTTP status code.
If I use "gpt-4" and "Aws" as the provider, then I tell the model to "Tell me an amazing story", I get this error:
```
Say: tell me an amazing story
Traceback (most recent call last):
File "C:\Users\lenovo\Documents\Projects\gpt4free-1\venv\Lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python311\Lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python311\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python311\Lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\Users\lenovo\Documents\Projects\gpt4free-1\main.py", line 7, in <module>
response = g4f.ChatCompletion.create(model='gpt-4', provider=g4f.Provider.Aws, messages=history)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\lenovo\Documents\Projects\gpt4free-1\g4f\__init__.py", line 48, in create
if stream else ''.join(engine._create_completion(model.name, messages, stream, **kwargs)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\lenovo\Documents\Projects\gpt4free-1\g4f\Provider\Providers\Aws.py", line 23, in _create_completion
yield (response.json()['choices'][0]['message']['content'])
^^^^^^^^^^^^^^^
File "C:\Users\lenovo\Documents\Projects\gpt4free-1\venv\Lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
```
I was able to get it to work a few days ago but since then I can't, can you give where you got the url "'https://4aiu6ctrknfxkoaigkigzh5lwm0cciuc.lambda-url.ap-east-1.on.aws/chat/completions", so I can try to fix the problem.
EDIT: The response shows a 502 HTTP status code.
If I use "gpt-4" and "Aws" as the provider, then I tell the model to "Tell me an amazing story", I get this error:
Hi, please take into account that this version is for developers only and is very unstable
I was able to get it to work a few days ago but since then I can't, can you give where you got the url "'https://4aiu6ctrknfxkoaigkigzh5lwm0cciuc.lambda-url.ap-east-1.on.aws/chat/completions", so I can try to fix the problem.