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

Error while processing function CreateCompletion #20

Open
User1391 opened this issue Dec 13, 2022 · 8 comments
Open

Error while processing function CreateCompletion #20

User1391 opened this issue Dec 13, 2022 · 8 comments

Comments

@User1391
Copy link

Here is the error message when running CreateCompletion

Error detected while processing function CreateCompletion: Traceback (most recent call last): File "<string>", line 1, in <module> NameError: name 'plugin' is not defined

@tom-doerr
Copy link
Owner

How did you add the plugin to vim?

@User1391
Copy link
Author

Using Plug

@tom-doerr
Copy link
Owner

No idea what the issue is, maybe you could just reinstall it. If that doesn't work, please send me the exact Plug line, path of the installed plugin on the filesystem and the output of the ls -la * command in that path.

@nhejazi
Copy link

nhejazi commented Jan 7, 2023

I just ran into this issue as well, and uninstalling + reinstalling didn't fix it. I'm using vim-plug to install in the usual way, and I see that an error flashes across the installation screen when this happens (too quick for me to read). my macOS Vim installation seems to have python3 support,

$ vim --version | grep "+python"
+cmdline_info      +libcall           +python3           +virtualedit

but I'm also seeing that the plugin seems to look for the openai installation in a way that is incompatible with pyenv, i.e., I've just done pip install openai, which installs the package in my "global" virtualenv -- not sure if this is related.

I guess https://github.com/tom-doerr/vim_codex/blob/main/plugin/vim_codex.vim#L20 is what's obviously failing but I'm not sure why

@tom-doerr
Copy link
Owner

Could you try installing openai in a virtualenv and running vim inside that?

@pooyaww
Copy link

pooyaww commented Feb 3, 2023

@tom-doerr I faced the same problem. But it happens randomly. When I ask for an auto completion with "Ctrl+X" and then I continue asking again then it randomly appears and goes away if I give it a pause. I think it should be about handling some errors/statuses that the API returns.

@tothlac
Copy link

tothlac commented Feb 3, 2023

Actually I have the same problem. I've just installed vim_codex, using the way specified in the documentation, so it is in my ~/.vim/bundle/vim_codex directory. Then I installed openai, and I have the same error.

@pooyaww
Copy link

pooyaww commented Feb 4, 2023

In my case it seems there is a limitation on API calls and not related to NameError: name plugin is not defined:

raise self.handle_error_response(
openai.error.RateLimitError: Rate limit reached for default-codex in organization org-xOr2p41SW53e8dvuSWUTdryJ on requests per min. Limit: 20.
000000 / min. Current: 30.000000 / min. Contact support@openai.com if you continue to have issues or if you’d like to request an increase. Ple
ase add a payment method to your account to increase your rate limit. Visit https://platform.openai.com/account/billing to add a payment metho
d.

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

5 participants