Closed rafpaf closed 2 months ago
@rafpaf Hey, good question. I guess the documentation still needs more refinement. 🙂 To switch between the agents, you can use :GpNextAgent
or :GpAgent XY
while the current buffer is a chat file. If the current buffer is something different (like buffers with standard code), these same commands control the 'Command Agents.'
The currently used agents are saved in a file, so the plugin remembers the last choice across Neovim instances.
I tried @rafpaf config and it's not working for me. I still get now 3.5 instead of 4
Gp: Chat agent: ChatGPT3-5 | Command agent: CodeGPT4
{
name = "ChatGPT3-5",
chat = false,
command = false,
},
{
name = "ChatGPT4",
chat = true,
command = true,
-- string with model name or table with model name and parameters
model = { model = "gpt-4-1106-preview", temperature = 1.1, top_p = 1 },
-- system prompt (use this to specify the persona/role of the AI)
system_prompt = "You are a general AI assistant.\n\n"
.. "The user provided the additional info about how they would like you to respond:\n\n"
.. "- If you're unsure don't guess and say you don't know instead.\n"
.. "- Ask question if you need clarification to provide better answer.\n"
.. "- Think deeply and carefully from first principles step by step.\n"
.. "- Zoom out first to see the big picture and then zoom in to details.\n"
.. "- Use Socratic method to improve your thinking and coding skills.\n"
.. "- Don't elide any code from your output if the answer requires coding.\n"
.. "- Take a deep breath; You've got this!\n",
},
@cserb Hey, so the following ain't working?
Or if you really want to disable the 3.5 permanently - putting the suggested section into config:
agents = {
-- Disable ChatGPT 3.5
{
name = "ChatGPT3-5",
chat = false, -- just name would suffice
command = false, -- just name would suffice
},
{
name = "ChatGPT4",
chat = true,
command = true,
-- string with model name or table with model name and parameters
model = { model = "gpt-4-1106-preview", temperature = 1.1, top_p = 1 },
-- system prompt (use this to specify the persona/role of the AI)
system_prompt = "You are a general AI assistant.\n\n"
.. "The user provided the additional info about how they would like you to respond:\n\n"
.. "- If you're unsure don't guess and say you don't know instead.\n"
.. "- Ask question if you need clarification to provide better answer.\n"
.. "- Think deeply and carefully from first principles step by step.\n"
.. "- Zoom out first to see the big picture and then zoom in to details.\n"
.. "- Use Socratic method to improve your thinking and coding skills.\n"
.. "- Don't elide any code from your output if the answer requires coding.\n"
.. "- Take a deep breath; You've got this!\n",
},
},
what is your ouput from :GpInspectPlugin
(using new neovim instance after config change)? I see:
...
_chat_agents = { "ChatGPT4" },
...
@Robitx :GpInspectPlugin returns:
_chat_agents = { "ChatGPT3-5", "ChatGPT4" },
_chat_finder_opened = false,
_command_agents = { "CodeGPT3-5", "CodeGPT4" },
The chat is working but the version shown is ChatGPT3-5
. And I want both to be ChatGPT4
Edit: I don't know what made the difference... honestly. But now it works.
@cserb no problem :slightly_smiling_face: I'm glad you've got it working.
In order to chat with ChatGPT4 inside Neovim, I had to add that agent but also disable ChatGPT3.5. Is that how it's supposed to work? If so, that wasn't totally clear to me at first, for what it's worth, though maybe there was something in the docs I missed.
By the way, this plugin interacts delightfully with Github Copilot, which helps write good follow-up questions.
In case it's valuable, here's an excerpt from my
init.lua
. I'm using lazy to manage plugins.