gemini.nvim icon indicating copy to clipboard operation
gemini.nvim copied to clipboard

Unknown function: _gemini_api_stream_async

Open gmankab opened this issue 1 year ago • 11 comments

i pressed ctrl+o, selected code explain, and got following error:

Error executing vim.schedule lua callback: ....local/share/nvim/lazy/gemini.nvim/lua/gemini/prompt.lua:69: Vim:E117: Unknown function: _gemini_api_stream_async
stack traceback:
        [C]: in function 'nvim_call_function'
        ....local/share/nvim/lazy/gemini.nvim/lua/gemini/prompt.lua:69: in function ''
        vim/_editor.lua: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>
Press ENTER or type command to continue

gmankab avatar Apr 03 '24 00:04 gmankab

Could you try to do :UpdateRemotePlugins again?

kiddos avatar Apr 04 '24 14:04 kiddos

Screenshot 2024-04-23 at 3 09 46 PM this is giving me error like this i have done the UpdateRemotePlugins but not working and i have stored the api in .zshrc but still the same error

hkhrithik007 avatar Apr 23 '24 09:04 hkhrithik007

What version of pynvim are you using?

kiddos avatar May 13 '24 17:05 kiddos

I am also having the same issue and have already done the UpdateRemotePlugins but the issue still remains

google-generativeai          0.5.3
pynvim                       0.5.0

vunguyen4920 avatar May 15 '24 16:05 vunguyen4920

What version of pynvim are you using?

Latest version installed by the script

hkhrithik007 avatar May 16 '24 04:05 hkhrithik007

Can you provide a minimum nvim config to replicate the issue?

That function is implemented in python, but somehow it's not registered in your setting. UpdateRemotePlugins should have registered it, but there might be something else interfering it.

kiddos avatar May 18 '24 17:05 kiddos

I have the same problem, I am just a user of lazynvim so I don't know how it works and all configuration files. But I noticed that nvim-data\rplugin.vim has no python3 plugin, in fact the file is almost empty (only comments). Don't know if this is related. Thanks

piertoni avatar Jun 12 '24 10:06 piertoni

I had similar problems and ithe thing that worked for me was the following. You need to run :UpdateRemotePlugins. But that call failed for me. And the reason it failed was because python3 provider was disabled in my Neovim config. I had this line in my config:

vim.g.loaded_python3_provider = 0

Also, I did ensured pynvim Python package is installed, not sure if it is needed, but I do have it.

So, to summarize:

  1. Ensure pynvim is installed by runnning pip3 install pynvim
  2. Ensure that Python3 provider is not disabled in Neovim config (check that :lua =vim.g.loaded_python3_provider outputs something other than 0. If so, check your configs and find where it is set to 0 and remove that.
  3. Run :UpdateRemotePlugins. This will install "gemini" remote provider.

maximkulkin avatar Jun 13 '24 04:06 maximkulkin

I had similar problems and ithe thing that worked for me was the following. You need to run :UpdateRemotePlugins. But that call failed for me. And the reason it failed was because python3 provider was disabled in my Neovim config. I had this line in my config:

vim.g.loaded_python3_provider = 0

Also, I did ensured pynvim Python package is installed, not sure if it is needed, but I do have it.

So, to summarize:

  1. Ensure pynvim is installed by runnning pip3 install pynvim
  2. Ensure that Python3 provider is not disabled in Neovim config (check that :lua =vim.g.loaded_python3_provider outputs something other than 0. If so, check your configs and find where it is set to 0 and remove that.
  3. Run :UpdateRemotePlugins. This will install "gemini" remote provider.

Thanks for suggestions, I followed all steps but unfortunately this did not work. This is the result of UpdateRemotePlugins, is it normal?:

remote/host: python3 host registered plugins []
remote/host: generated rplugin manifest: C:\Users\pnnp\AppData\Local\nvim-data/rplugin.vim

The rplugin.vim is empty (not considering comments) Thanks

piertoni avatar Jun 13 '24 08:06 piertoni

remote/host: python3 host registered plugins []
remote/host: generated rplugin manifest: C:\Users\pnnp\AppData\Local\nvim-data/rplugin.vim

The rplugin.vim is empty (not considering comments) Thanks

Same situation here

mous16 avatar Jun 14 '24 12:06 mous16

I am working on rewriting the http request using FFI. I notice that python plugin run kinda slow in WSL for some reason.

kiddos avatar Aug 04 '24 12:08 kiddos

I remove the python binding part and use curl to retrieve the result. closing this.

kiddos avatar Dec 22 '24 03:12 kiddos