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

WIP: display why I can't change the chat agent #216

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

teto
Copy link
Collaborator

@teto teto commented Sep 23, 2024

for some reason, GpAgent refused to autocomplete ChatGPT. Looking at the code, it refused to set the chat agent under some conditions (Is this a new behavior ?). :GpAgent ChatGPT4o would return ChatGPT4o is not a valid agent for current buffer" which is not very helpful (why ? how can I fix this). I've refactored not_chat to remove the negation into is_chat with a return pattern used widely in luarock return success (boolean), err_msg .

So right now I can see why it refuses to change:

:GpAgent ChatGPT4o                                                                                                                          
false resolved file (/home/teto/gp.nvim/lua/gp/init.lua) not in chat dir (/home/teto/.local/share/nvim/gp/chats)                                                                                
Press ENTER or type command to continue    

I am still not sure why we want to prevent that

@Robitx
Copy link
Owner

Robitx commented Sep 24, 2024

Agents are currently a bundle of model settings and a system prompt leading to some agents being good for chats, while others for code operations.

The bundling is there, because different LLMs (and different tasks) might have different needs. In general, it's better to have a lower temperature for coding (less hallucinations) and weaker models (like llama) might need a different/custom sys prompt to force it work properly.

In a chat buffer :GpAgent autocompletes only agents which have chat = true, configured, in any other buffer it completes code agents (command = true,).

		{
			name = "ChatGPT4o",
			chat = true,
			command = false,
			-- string with model name or table with model name and parameters
			model = { model = "gpt-4o", temperature = 1.1, top_p = 1 },
			-- system prompt (use this to specify the persona/role of the AI)
			system_prompt = require("gp.defaults").chat_system_prompt,
		},
		{
			provider = "openai",
			name = "CodeGPT4o",
			chat = false,
			command = true,
			-- string with model name or table with model name and parameters
			model = { model = "gpt-4o", temperature = 0.8, top_p = 1 },
			-- system prompt (use this to specify the persona/role of the AI)
			system_prompt = require("gp.defaults").code_system_prompt,
		},

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

Successfully merging this pull request may close these issues.

2 participants