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

Question: How to Provide `.gp.md` file as Context for GpChatNew

Open harrisoncramer opened this issue 1 year ago • 4 comments

Hello,

Thank you for the great plugin! This is just a question.

I've used the GpContext command to create a .gp.md file in my repository that contains some information. However, when I run a GpChatNew command and ask the AI questions that are relevant to the context provided, it does not know how to answer. For instance, if I tell it my favorite color is red in the context file, the AI does not seem to retain that information in the chat.

This is using the default GPT-4 model.

Is there something I have to do to provide this context to every chat session in this repository automatically? Thank you!

harrisoncramer avatar Aug 26 '24 14:08 harrisoncramer

Hey did you figure this out? Running to the same question.

Mikkolehtimaki avatar Sep 24 '24 14:09 Mikkolehtimaki

No I didn't

harrisoncramer avatar Sep 24 '24 22:09 harrisoncramer

I also just tried that unsuccessfully. I honestly was expected behavior for me: to automatically establish context when starting new chats.

Otherwise thank you for this Plugin! I really like it.

nikbrunner avatar Dec 25 '24 12:12 nikbrunner

Maybe someone will find it helpful. I'm using this workaround with a custom function on top of the .gp.md functionality per repository. It should be easy to create a wrapper around :GpChatNew and call it directly from nvim.

function gpt() {
    local current_path=$(pwd)
    nvim -c "GpChatNew" \
         -c "lcd $current_path" \
         -c "normal iKeep your responses short and simple, when asked to provide command, provide only one. Do not provide explanations unless explicitly asked for." \
         -c "normal o" \
         -c "call timer_start(100, {-> feedkeys('A', 'n')})"
}

Piotr1215 avatar Jan 25 '25 09:01 Piotr1215