Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation #1

Closed
ghost opened this issue Sep 26, 2021 · 38 comments
Closed

Installation #1

ghost opened this issue Sep 26, 2021 · 38 comments

Comments

@ghost
Copy link

ghost commented Sep 26, 2021

N

@tom-doerr
Copy link
Owner

Do you have oh-my-zsh installed? It might be necessary for the plugin to work. https://ohmyz.sh/

@tom-doerr
Copy link
Owner

tom-doerr commented Sep 26, 2021 via email

@johnkegd
Copy link
Contributor

I followed all the steps and installed everything from the instructions but it still doesn't work trying to complete some text with Ctrl+x or anything.
I like the idea. would be nice to test it.

@tom-doerr
Copy link
Owner

tom-doerr commented Sep 27, 2021 via email

@johnkegd
Copy link
Contributor

johnkegd commented Sep 27, 2021

it's just showing the next message: No such shell function create_completion
i'm using ZSH version: 5.8
Iterm2 version: 3.4.10
pip version: 21.2.4
openai last version

like this looks my oh-my-zsh plugins config
plugins=( git zsh-syntax-highlighting zsh-autosuggestions zsh-codex bundler ) zle -N create_completion bindkey '^X' create_completion

i already check the repositories in ~/.oh-my-zsh/plugins and the Repo zsh_codex is there.

@tom-doerr
Copy link
Owner

tom-doerr commented Sep 27, 2021 via email

@johnkegd
Copy link
Contributor

johnkegd commented Sep 27, 2021

I already did it and it does not work. I had instinctively put it in the main plugins folder after the fatal destination path error was generated after trying to download it with the instructions in the documentation.

It must complete words after ctrl + x anywhere in the terminal? or what should be the behavior? not very clear with the gif example.

@tom-doerr
Copy link
Owner

Yes, it should always complete your text when you press ctrl + x.
Could you add

plugins=(zsh_codex)
zle -N create_completion
bindkey '^X' create_completion

to the very end of your .zshrc? Maybe something gets overwritten by another plugin.

@johnkegd
Copy link
Contributor

johnkegd commented Sep 28, 2021

Well now it is trying to do something.
create_completion.py", line 3, in <module>
import openai ModuleNotFoundError: No module named 'openai'

@tom-doerr
Copy link
Owner

Try pip3 install openai

@johnkegd
Copy link
Contributor

johnkegd commented Sep 28, 2021

Thanks Tom, now it seems to be a problem with the engine davinci-codex.

line 67, in <module> response = openai.Completion.create(engine='davinci-codex', prompt=input_prompt, temperature=0.5, max_tokens=32, stream=STREAM)

line 31, in create return super().create(*args, **kwargs)

line 66, in create response, _, api_key = requestor.request( File "api_requestor.py", line 129, in request resp = self.interpret_response(rbody, rcode, rheaders, stream=stream)

line 348, in interpret_response return self.interpret_response_line(rbody, rcode, rheaders, stream)

line 367, in interpret_response_line raise self.handle_error_response( openai.error.InvalidRequestError: Engine not found

It works properly changing he engine='davinci-codex' to engine='davinci' openai default engine. I already tested it and works

but it should work with the engine='davinci-codex' right?

@tom-doerr
Copy link
Owner

Yes, it should. davinci is just the normal language model. You might be able to use this to complete the text in the shell, but I suspect it's far from the performance of Codex.
To access davinci-codex you need to get Codex access from OpenAI, just having access to the normal API is not enough.
https://openai.com/blog/openai-codex/

@tom-doerr tom-doerr pinned this issue Sep 29, 2021
@tom-doerr
Copy link
Owner

Please comment again if you are still having issues.

@tom-doerr
Copy link
Owner

Could you post your ~/.zshrc?

@tom-doerr tom-doerr reopened this Sep 30, 2021
@tom-doerr
Copy link
Owner

Traditionally it's located in your home directory (~). Do you mean by admin directory the home directory?

@tom-doerr
Copy link
Owner

Just to clarify: You home directory can very well be named admin. If you are not sure if this is your home directory, please run the commands pwd and echo ~ and post the outputs.

@ghost

This comment has been minimized.

@tom-doerr
Copy link
Owner

That looks good. Please go to ~/.oh-my-zsh/custom/plugins/zsh_codex and run the commands pwd and ls -la and send the ouput.

@tom-doerr
Copy link
Owner

Please run echo $ZSH_CUSTOM

@tom-doerr
Copy link
Owner

Please run echo $plugins.

@tom-doerr
Copy link
Owner

which create_completion

@tom-doerr
Copy link
Owner

It's a command :D Please run it.

@tom-doerr
Copy link
Owner

tom-doerr commented Sep 30, 2021

Please run

source ~/.oh-my-zsh/custom/plugins/zsh_codex/zsh_codex.plugin.zsh 
zle -N create_completion        
bindkey '^X' create_completion  

and then hit Ctrl + X to see what happens.

@tom-doerr
Copy link
Owner

cat ~/.oh-my-zsh/custom/plugins/zsh_codex/zsh_codex.plugin.zsh 

@ghost

This comment has been minimized.

@tom-doerr
Copy link
Owner

I'm starting to run out of ideas. We should be able to access the function create_completion after we loaded it using source ~/.oh-my-zsh/custom/plugins/zsh_codex/zsh_codex.plugin.zsh.

@architkuiya
Copy link

No such shell function 'create_completion'

I am getting the same problem.

@JaskiratSudan
Copy link

what do we have to write in organization_id?

@tom-doerr
Copy link
Owner

@JaskiratSudan The organization ID that OpenAI assigns to you. If you have access to Codex, you can find it here: https://beta.openai.com/account/api-keys

@tom-doerr
Copy link
Owner

@architkuiya What operating system are you using?

@architkuiya
Copy link

Parrot OS

@architkuiya What operating system are you using?

@tom-doerr
Copy link
Owner

@architkuiya
When you run

source ~/.oh-my-zsh/custom/plugins/zsh_codex/zsh_codex.plugin.zsh 
zle -N create_completion        
bindkey '^X' create_completion  

do you get the same error as well?

@architkuiya
Copy link

create_completion:3: no such file or directory: /plugins/zsh_codex/create_completion.py

@tom-doerr
Copy link
Owner

Please try to set your ZSH_CUSTOM path using

export ZSH_CUSTOM=~/.oh-my-zsh/custom

@rinshadka
Copy link

Hi, I have been waiting long for the openai account , is there any one who got an account from them,

My plugin installation completed , only need to get secret/organization_id to try out this plugin

@tom-doerr
Copy link
Owner

@architkuiya Could you clone the repo again?

git clone https://github.com/tom-doerr/zsh_codex.git ~/.oh-my-zsh/custom/plugins/ 

@architkuiya
Copy link

@architkuiya Could you clone the repo again?

git clone https://github.com/tom-doerr/zsh_codex.git ~/.oh-my-zsh/custom/plugins/ 

fatal: destination path '/home/archit/.oh-my-zsh/custom/plugins' already exists and is not an empty directory.

@ghost ghost closed this as completed Oct 9, 2021
@no-vici
Copy link

no-vici commented May 24, 2023

For those who got:

raise self.handle_error_response( openai.error.InvalidRequestError: The model: "code-davinci-002" does not exist

Just replace engine with model and code-davinci-002 with text-davinci-003 (latest).

Enjoy.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants