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

bug: The function name 'python' is reserved for use by this model

Open jfpedroza opened this issue 8 months ago • 5 comments

Describe the bug

When using the new model o4-mini the following error appears:

Error: "API request failed with status 400. Body: \"{\\n  \\\"error\\\": {\\n    \\\"message\\\": \\\"The function name 'python' is reserved for use by this model. Please use a different function name.\\\",\\n    \\\"type\\\": \\\"invalid_request_error\\\",\\n    \\\"param\\\": null,\\n    \\\"code\\\": null\\n  }\\n}\""

To reproduce

No response

Expected behavior

No response

Installation method

Use lazy.nvim:

{
  "yetone/avante.nvim",
  event = "VeryLazy",
  lazy = false,
  version = false, -- set this if you want to always pull the latest change
  opts = {
    -- add any opts here
  },
  -- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
  build = "make",
  -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows
  dependencies = {
    "nvim-treesitter/nvim-treesitter",
    "stevearc/dressing.nvim",
    "nvim-lua/plenary.nvim",
    "MunifTanjim/nui.nvim",
  },
}

Environment

neovim version 0.11.0

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    -- add any other plugins here
  },
})

jfpedroza avatar Apr 17 '25 09:04 jfpedroza

@jfpedroza try to use value gpt-4o-mini

Like this:

    ...
    openai = {
      model = "gpt-4o-mini", 
      ....
    },
   ...

Klojer avatar Apr 26 '25 18:04 Klojer

@Klojer that's a bit besides the point. 4o and o4 are different models (yes, the naming on OpenAI's side sucks a bit). And seeing as o4 is supposed to be good at coding, that's the model we want to use.

mmainz avatar Apr 28 '25 07:04 mmainz

i have the same problem. 04-mini does not work and gets the same error

AlpMimaroglu avatar Apr 28 '25 10:04 AlpMimaroglu

Hi! I'm running into the same issue using openai/o3:

- Datetime: 2025-04-29 17:53:52

- Model: openai/o3

- Selected files:
  - src/react/src/App.tsx

> the first names should start with "C".



Error: "API request failed with status 400. Body: \"{\\n  \\\"error\\\": {\\n    \\\"message\\\": \\\"The function name 'python' is reserved for use by this model. Please use a different function name.\\\",\\n    \\\"type\\\": \\\"invalid_request_error\\\",\\n    \\\"param\\\": null,\\n    \\\"code\\\": null\\n  }\\n}\""

andreasthoelke avatar Apr 29 '25 16:04 andreasthoelke

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar May 30 '25 02:05 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Jun 04 '25 02:06 github-actions[bot]