feat: allow disabling tools for claude & copilot (#1300)

This commit is contained in:
Lucas Pereira
2025-02-19 17:00:10 +01:00
committed by GitHub
parent 3476eabc4c
commit 36f8db9629
2 changed files with 4 additions and 2 deletions

View File

@@ -250,9 +250,10 @@ M.parse_curl_args = function(provider, prompt_opts)
H.refresh_token(false, false)
local provider_conf, request_body = P.parse_config(provider)
local disable_tools = provider_conf.disable_tools or false
local tools = {}
if prompt_opts.tools then
if not disable_tools and prompt_opts.tools then
for _, tool in ipairs(prompt_opts.tools) do
table.insert(tools, OpenAI.transform_tool(tool))
end