Robitx / gp.nvim

Gp.nvim (GPT prompt) Neovim AI plugin: ChatGPT sessions & Instructable text/code operations & Speech to text [OpenAI, Ollama, Anthropic, ..]
MIT License
775 stars 66 forks source link

Trouble running the o1-preview model #218

Closed danielreis1 closed 1 day ago

danielreis1 commented 1 day ago

image I have this config for the o1 model, I added on top of a gp4 working config, everything seemed to be fine with the last one, but now, the config isn't updating and adding the o1 model, even after deleting the gpt4o agent I am still getting gpt4o answers, even after I restart neovim I have this problem

Robitx commented 1 day ago

First thing - do you have at least tier 4 to access o1? https://platform.openai.com/docs/guides/rate-limits/usage-tiers?context=tier-four

danielreis1 commented 1 day ago

First thing - do you have at least tier 4 to access o1? https://platform.openai.com/docs/guides/rate-limits/usage-tiers?context=tier-four

It was a problem with the config: I disabled the other agents (I supposed these were the default agents), you really have to do this, I didn't see a way around in the docs I used: in the agents menu of the config

agents = {

  {
    name = "ChatGPT3-5",
    disable = true,
  },
  {
    -- a commands agent is usually to make a quick function very fast, without the need to toggle
    --  the chat
    name = "ChatGPT4o",
    disable = true,
  },
  { 
    -- a commands agent is usually to make a quick function very fast, without the need to toggle
    --  the chat
    name = "ChatGPT4o-mini",
    disable = true,
  },
},

and added the new agents:

  {
    name = "o1Preview",
    chat = true,
    command = false,
    -- string with model name or table with model name and parameters
    model = { model = "o1-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"
    .. "- 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",
  },
  { 
    name = "o1PreviewCommands",
    chat = false,
    command = true,
    -- string with model name or table with model name and parameters
    model = { model = "o1-preview", temperature = 1.1, top_p = 1 },
    -- system prompt (use this to specify the persona/role of the AI)
    system_prompt = "You are an AI working as a code editor.\n\n"
    .. "Please AVOID COMMENTARY OUTSIDE OF THE SNIPPET RESPONSE.\n"
    .. "START AND END YOUR ANSWER WITH:\n\n```",
  },