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

bug: Tool names are not allowed to be [search] in Qwen-max model #1219

Open
jiangyinzuo opened this issue Feb 8, 2025 · 5 comments
Open
Labels
bug Something isn't working

Comments

@jiangyinzuo
Copy link

jiangyinzuo commented Feb 8, 2025

Describe the bug

When I use Qwen-max (OpenAI API compatible) model, it report an error:

Error: "API request failed with status 400. Body: '{\"error\":{\"code\":\"invalid_parameter_error\",\"param\":null,\"message\":\"<400> InternalError.Algo.InvalidParameter: Tool names are not allowed to be [search]\",\"type\":\"invalid_request_error\"},\"id\":\"chatcmpl-a4bbe484-ca49-936e-8a58-8eb586f682de\",\"request_id\":\"a4bbe484-ca49-936e-8a58-8eb586f682de\"}'"

If we rename the tool name "search" to "search_keyword" in llm_tools.lua, it works well.

name = "search",

To reproduce

No response

Expected behavior

No response

Installation method

Use lazy.nvim

Environment

NVIM v0.11.0-dev-af069c5

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
  },
})
@jiangyinzuo jiangyinzuo added the bug Something isn't working label Feb 8, 2025
@zsmatrix62
Copy link

zsmatrix62 commented Feb 10, 2025

Yes, i got the same error, have to set 'disable_tools' in the config;

@MrZLeo
Copy link

MrZLeo commented Feb 13, 2025

I am wondering whether there is a list of tools being used in avante.nvim.

@fang2hou
Copy link

@MrZLeo
Here is the list I guess

@fang2hou
Copy link

Add some little hack on lazy.nvim option table making can solve this:

{
    "yetone/avante.nvim",
    opts = function()
        local llm_tools = require("avante.llm_tools")
        for _, tool in pairs(llm_tools.tools) do
            if tool.name == "search" then
                tool.name = "local_search"
            end
        end
        ---@diagnostic disable-next-line: inject-field
        llm_tools.tools.local_search = llm_tools.search
    end,
},

@MrZLeo
Copy link

MrZLeo commented Feb 18, 2025

@MrZLeo Here is the list I guess

avante.nvim/lua/avante/llm_tools.lua

Line 421 in b20b2ca

M.tools = {

Cool! Maybe we should use AI to generate the missing documentation. 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants