Giter Club home page Giter Club logo

Comments (38)

tom-doerr avatar tom-doerr commented on July 19, 2024 1

Please try to set your ZSH_CUSTOM path using

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

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024

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

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024

from zsh_codex.

johnkegd avatar johnkegd commented on July 19, 2024

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.

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024

from zsh_codex.

johnkegd avatar johnkegd commented on July 19, 2024

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.

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024

from zsh_codex.

johnkegd avatar johnkegd commented on July 19, 2024

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.

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024

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.

from zsh_codex.

johnkegd avatar johnkegd commented on July 19, 2024

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

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024

Try pip3 install openai

from zsh_codex.

johnkegd avatar johnkegd commented on July 19, 2024

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?

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024

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/

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024

Please comment again if you are still having issues.

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024

Could you post your ~/.zshrc?

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024

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

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024

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.

from zsh_codex.

 avatar commented on July 19, 2024

Screen Shot 2021-09-29 at 9 54 50 PM

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024

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.

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024

Please run echo $ZSH_CUSTOM

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024

Please run echo $plugins.

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024

which create_completion

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024

It's a command :D Please run it.

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024

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.

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024
cat ~/.oh-my-zsh/custom/plugins/zsh_codex/zsh_codex.plugin.zsh 

from zsh_codex.

 avatar commented on July 19, 2024

Screen Shot 2021-09-29 at 10 52 04 PM

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024

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.

from zsh_codex.

architkuiya avatar architkuiya commented on July 19, 2024

No such shell function 'create_completion'

I am getting the same problem.

from zsh_codex.

JaskiratSudan avatar JaskiratSudan commented on July 19, 2024

what do we have to write in organization_id?

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024

@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

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024

@architkuiya What operating system are you using?

from zsh_codex.

architkuiya avatar architkuiya commented on July 19, 2024

Parrot OS

@architkuiya What operating system are you using?

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024

@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?

from zsh_codex.

architkuiya avatar architkuiya commented on July 19, 2024

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

from zsh_codex.

rinshadka avatar rinshadka commented on July 19, 2024

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

from zsh_codex.

tom-doerr avatar tom-doerr commented on July 19, 2024

@architkuiya Could you clone the repo again?

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

from zsh_codex.

architkuiya avatar architkuiya commented on July 19, 2024

@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.

from zsh_codex.

no-vici avatar no-vici commented on July 19, 2024

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.

from zsh_codex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.