You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have copied the Explain hook exactly as the docs show into my config. But when I select some code and run the explain command, I get a pop up that says it didn't receive any selected text, only the filepath:
Here is my current config:
return {
"robitx/gp.nvim",
config=function()
require("gp").setup({
openai_api_key=os.getenv("OPENAI_API_KEY"),
agents= {
{
name="GPT-4o",
chat=true,
command=true,
model= { model="gpt-4o", temperature=1.1, top_p=1 },
system_prompt="You are a helpful assistant. Keep your answers concise. When providing code, put the code in triple backticks for markdown formatting. Use 'typescript' for tsx and ts code blocks, never 'typescriptreact'.",
},
},
hooks= {
-- explains the selected codeExplain=function(gp, params)
localtemplate="I have the following code from {{filename}}:\n\n".."```{{filetype}}\n{{selection}}\n```\n\n".."Please respond by explaining the code above."localagent=gp.get_chat_agent()
gp.Prompt(params, gp.Target.popup, nil, agent.model, template, agent.system_prompt)
end,
-- opens new chat with the entire current buffer as a contextBufferChatNew=function(gp, _)
-- call GpChatNew command in range mode on whole buffervim.api.nvim_command("%" ..gp.config.cmd_prefix.."ChatNew")
end,
},
chat_confirm_delete=false,
})
end,
}
Sidenote, the BufferChatNew hook works perfectly. But the Explain hook is not receiving the selected text.
The text was updated successfully, but these errors were encountered:
I have copied the Explain hook exactly as the docs show into my config. But when I select some code and run the explain command, I get a pop up that says it didn't receive any selected text, only the filepath:
![image](https://private-user-images.githubusercontent.com/48610822/337828497-590fa093-6269-428e-a3b6-1d8b7c4ea092.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE0MjI5MDMsIm5iZiI6MTcyMTQyMjYwMywicGF0aCI6Ii80ODYxMDgyMi8zMzc4Mjg0OTctNTkwZmEwOTMtNjI2OS00MjhlLWEzYjYtMWQ4YjdjNGVhMDkyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE5VDIwNTY0M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNkOWEwZTRmMDFiMmZlMjBmNzE0NjVlNjU4NWMxMGZiYzA3N2E4ZTQ1MjNiODFkNjY4MGQ4ZTcxYjAwOTk4NjMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.pz_KQMzDTFcLW96QrkKRUmKuBanvz4YM9GG_-NDek_s)
Here is my current config:
Sidenote, the BufferChatNew hook works perfectly. But the Explain hook is not receiving the selected text.
The text was updated successfully, but these errors were encountered: