Bryley / neoai.nvim

Neovim plugin for intracting with GPT models from OpenAI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't get the context command to work

wirtsi opened this issue · comments

commented

Selecting text in visual mode and issuing :NeoAIContext gives me this error

E5108: Error executing lua ...local/share/nvim/lazy/neoai.nvim/lua/neoai/chat/init.lua:98: attempt to index field 'chat_history' (a nil value) stack traceback: ...local/share/nvim/lazy/neoai.nvim/lua/neoai/chat/init.lua:98: in function 'send_prompt' ...rause/.local/share/nvim/lazy/neoai.nvim/lua/neoai/ui.lua:142: in function 'send_prompt' ...rause/.local/share/nvim/lazy/neoai.nvim/lua/neoai/ui.lua:132: in function 'submit_prompt' [string ":lua"]:1: in main chunk

This happens on first call and also when entering a prompt

commented

Thanks for the feedback. I believe the issue was the fact that I was setting the chat_history variable back to nil when setting the context which stuffed up when the GUI was already opened.