tom-doerr / zsh_codex

This is a ZSH plugin that enables you to use OpenAI's Codex AI in the command line.
MIT License
1.42k stars 72 forks source link

No such model: code-davinci-002 #16

Open kwanUm opened 2 years ago

kwanUm commented 2 years ago

I'm getting the error in title. org_id & secret_key are correct, but I still get the error immediately after pressing ^X.

Anyone else experiences that?

kwanUm commented 2 years ago

Traceback (most recent call last):
File "/private/home/orik/.oh-my-zsh/custom/plugins/zsh_codex/create_completion.py", line 64, in response = openai.Completion.create(engine='code-davinci-002', prompt=prompt_prefix, suffix=prompt_suffix, temperature=0.5, max_tokens=50, stream=STREAM) File "/private/home/orik/.conda/envs/design5_py38/lib/python3.8/site-packages/openai/api_resources/completion.py", line 31, in create return super().create(*args, **kwargs) File "/private/home/orik/.conda/envs/design5_py38/lib/python3.8/site-packages/openai/api_resources/abstract/engine_apiresource.py", line 100, in create response, , api_key = requestor.request( File "/private/home/orik/.conda/envs/design5_py38/lib/python3.8/site-packages/openai/api_requestor.py", line 120, in request resp, got_stream = self._interpret_response(result, stream) File "/private/home/orik/.conda/envs/design5_py38/lib/python3.8/site-packages/openai/api_requestor.py", line 327, in _interpret_response self._interpret_response_line( File "/private/home/orik/.conda/envs/design5_py38/lib/python3.8/site-packages/openai/api_requestor.py", line 360, in _interpret_response_line raise self.handle_error_response( openai.error.InvalidRequestError: No such model: code-davinci-002

tom-doerr commented 2 years ago

Do you have access to Codex? Having access to the OpenAI API is not enough. More Info: https://github.com/tom-doerr/zsh_codex/issues/15 https://github.com/tom-doerr/zsh_codex/issues/13

tupacalypse187 commented 1 year ago

I know this is an old issue, but I see this happening for me. I have a paid codex account setup but get the below error. Has the model changed and needs to be adjusted or is this an issue on my end? Thanks.

I'm using Hyper.js with Fig and zsh. Thank you.

# show the number of files in the current directoryTraceback (most recent call last):
  File "/Users/cyantorno/.oh-my-zsh/custom/plugins/zsh_codex/create_completion.py", line 64, in <module>
    response = openai.Completion.create(engine='code-davinci-002', prompt=prompt_prefix, suffix=prompt_suffix, temperature=0.5, max_tokens=50, stream=STREAM)
  File "/Users/cyantorno/Library/Python/3.9/lib/python/site-packages/openai/api_resources/completion.py", line 25, in create
    return super().create(*args, **kwargs)
  File "/Users/cyantorno/Library/Python/3.9/lib/python/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
    response, _, api_key = requestor.request(
  File "/Users/cyantorno/Library/Python/3.9/lib/python/site-packages/openai/api_requestor.py", line 226, in request
    resp, got_stream = self._interpret_response(result, stream)
  File "/Users/cyantorno/Library/Python/3.9/lib/python/site-packages/openai/api_requestor.py", line 619, in _interpret_response
    self._interpret_response_line(
  File "/Users/cyantorno/Library/Python/3.9/lib/python/site-packages/openai/api_requestor.py", line 682, in _interpret_response_line
    raise self.handle_error_response(
openai.error.InvalidRequestError: The model: `code-davinci-002` does not exist
oyale commented 1 year ago

OpenAI has discontinued code-davinci models:

On March 23rd, we will discontinue support for the Codex API. All customers will have to transition to a different model. Codex was initially introduced as a free limited beta in 2021, and has maintained that status to date. Given the advancements of our newest GPT-3.5 models for coding tasks, we will no longer be supporting Codex and encourage all customers to transition to GPT-3.5-Turbo.

On March 23rd, we will discontinue support for the Codex API. All customers will have to transition to a different model. Codex was initially introduced as a free limited beta in 2021, and has maintained that status to date. Given the advancements of our newest GPT-3.5 models for coding tasks, we will no longer be supporting Codex and encourage all customers to transition to GPT-3.5-Turbo.

Models affected The following models will be discontinued:

code-cushman:001
code-cushman:002
code-davinci:001
code-davinci:002

We understand this transition may be temporarily inconvenient, but we are confident it will allow us to increase our investment in our latest and most capable models.