Closed TheCrockett closed 1 year ago
Looks like the limited beta has ended for GPT-4, their nomenclature has changed.
curl https://api.openai.com/v1/models -H "Authorization: Bearer $(cat openai_key.txt)
I have paid for an account, so I may try and troubleshoot tomorrow.
you may not have access to the gpt-4
api yet. it's still by waitlist. you can use gpt-3.5-turbo
instead
[$USER@$OS wolverine]$ python3 -m venv venv [$USER@$OS wolverine]$ source venv/bin/activate (venv) [$USER@$OS wolverine]$ pip install -r requirements.txt Collecting aiohttp==3.8.4 Using cached aiohttp-3.8.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB) Collecting aiosignal==1.3.1 Using cached aiosignal-1.3.1-py3-none-any.whl (7.6 kB) Collecting async-timeout==4.0.2 Using cached async_timeout-4.0.2-py3-none-any.whl (5.8 kB) Collecting attrs==22.2.0 Using cached attrs-22.2.0-py3-none-any.whl (60 kB) Collecting certifi==2022.12.7 Using cached certifi-2022.12.7-py3-none-any.whl (155 kB) Collecting charset-normalizer==3.1.0 Using cached charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (197 kB) Collecting fire==0.5.0 Using cached fire-0.5.0.tar.gz (88 kB) Preparing metadata (setup.py) ... done Collecting flake8==6.0.0 Using cached flake8-6.0.0-py2.py3-none-any.whl (57 kB) Collecting frozenlist==1.3.3 Using cached frozenlist-1.3.3-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (154 kB) Collecting idna==3.4 Using cached idna-3.4-py3-none-any.whl (61 kB) Collecting mccabe==0.7.0 Using cached mccabe-0.7.0-py2.py3-none-any.whl (7.3 kB) Collecting multidict==6.0.4 Using cached multidict-6.0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (117 kB) Collecting openai==0.27.2 Using cached openai-0.27.2-py3-none-any.whl (70 kB) Collecting pycodestyle==2.10.0 Using cached pycodestyle-2.10.0-py2.py3-none-any.whl (41 kB) Collecting pyflakes==3.0.1 Using cached pyflakes-3.0.1-py2.py3-none-any.whl (62 kB) Collecting requests==2.28.2 Using cached requests-2.28.2-py3-none-any.whl (62 kB) Collecting six==1.16.0 Using cached six-1.16.0-py2.py3-none-any.whl (11 kB) Collecting termcolor==2.2.0 Using cached termcolor-2.2.0-py3-none-any.whl (6.6 kB) Collecting tqdm==4.65.0 Using cached tqdm-4.65.0-py3-none-any.whl (77 kB) Collecting urllib3==1.26.15 Using cached urllib3-1.26.15-py2.py3-none-any.whl (140 kB) Collecting yarl==1.8.2 Using cached yarl-1.8.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (278 kB) Using legacy 'setup.py install' for fire, since package 'wheel' is not installed. Installing collected packages: urllib3, tqdm, termcolor, six, pyflakes, pycodestyle, multidict, mccabe, idna, frozenlist, charset-normalizer, certifi, attrs, async-timeout, yarl, requests, flake8, fire, aiosignal, aiohttp, openai Running setup.py install for fire ... done Successfully installed aiohttp-3.8.4 aiosignal-1.3.1 async-timeout-4.0.2 attrs-22.2.0 certifi-2022.12.7 charset-normalizer-3.1.0 fire-0.5.0 flake8-6.0.0 frozenlist-1.3.3 idna-3.4 mccabe-0.7.0 multidict-6.0.4 openai-0.27.2 pycodestyle-2.10.0 pyflakes-3.0.1 requests-2.28.2 six-1.16.0 termcolor-2.2.0 tqdm-4.65.0 urllib3-1.26.15 yarl-1.8.2
[notice] A new release of pip available: 22.2.2 -> 23.0.1 [notice] To update, run: pip install --upgrade pip (venv) [$USER@$OS wolverine]$ python wolverine.py buggy_script.py "subtract" 20 3 Script crashed. Trying to fix... Output: Traceback (most recent call last): File "/home/$USER/rse/open_source/wolverine/buggy_script.py", line 30, in
fire.Fire(calculate)
File "/home/$USER/rse/open_source/wolverine/venv/lib64/python3.11/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/$USER/rse/open_source/wolverine/venv/lib64/python3.11/site-packages/fire/core.py", line 475, in _Fire
component, remaining_args = _CallAndUpdateTrace(
^^^^^^^^^^^^^^^^^^^^
File "/home/$USER/rse/open_source/wolverine/venv/lib64/python3.11/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^
File "/home/$USER/rse/open_source/wolverine/buggy_script.py", line 18, in calculate
result = subtract_numbers(num1, num2)
^^^^^^^^^^^^^^^^
NameError: name 'subtract_numbers' is not defined
Traceback (most recent call last): File "/home/$USER/rse/open_source/wolverine/wolverine.py", line 153, in
fire.Fire(main)
File "/home/$USER/rse/open_source/wolverine/venv/lib64/python3.11/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/$USER/rse/open_source/wolverine/venv/lib64/python3.11/site-packages/fire/core.py", line 475, in _Fire
component, remaining_args = _CallAndUpdateTrace(
^^^^^^^^^^^^^^^^^^^^
File "/home/$USER/rse/open_source/wolverine/venv/lib64/python3.11/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace
component = fn(*varargs, *kwargs)
^^^^^^^^^^^^^^^^^^^^^^
File "/home/$USER/rse/open_source/wolverine/wolverine.py", line 142, in main
json_response = send_error_to_gpt(
^^^^^^^^^^^^^^^^^^
File "/home/$USER/rse/open_source/wolverine/wolverine.py", line 55, in send_error_to_gpt
response = openai.ChatCompletion.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/$USER/rse/open_source/wolverine/venv/lib64/python3.11/site-packages/openai/api_resources/chat_completion.py", line 25, in create
return super().create(args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/$USER/rse/open_source/wolverine/venv/lib64/python3.11/site-packages/openai/api_resources/abstract/engine_apiresource.py", line 153, in create
response, , api_key = requestor.request(
^^^^^^^^^^^^^^^^^^
File "/home/$USER/rse/open_source/wolverine/venv/lib64/python3.11/site-packages/openai/api_requestor.py", line 226, in request
resp, got_stream = self._interpret_response(result, stream)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/$USER/rse/open_source/wolverine/venv/lib64/python3.11/site-packages/openai/api_requestor.py", line 619, in _interpret_response
self._interpret_response_line(
File "/home/$USER/rse/open_source/wolverine/venv/lib64/python3.11/site-packages/openai/api_requestor.py", line 682, in _interpret_response_line
raise self.handle_error_response(
openai.error.InvalidRequestError: The model
gpt-4
does not exist