fix: copilot's openai tool description cannot use long text (#1700)

This commit is contained in:
yetone
2025-03-24 19:54:06 +08:00
committed by GitHub
parent e20a3ff111
commit 25e9b1c111
5 changed files with 18 additions and 8 deletions

View File

@@ -2,14 +2,21 @@ local Path = require("plenary.path")
local Utils = require("avante.utils")
local Helpers = require("avante.llm_tools.helpers")
local Base = require("avante.llm_tools.base")
local Config = require("avante.config")
local Providers = require("avante.providers")
---@class AvanteLLMTool
local M = setmetatable({}, Base)
M.name = "bash"
M.description =
[[Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.
M.get_description = function()
local provider = Providers[Config.provider]
if Config.provider:match("copilot") and provider.model and provider.model:match("gpt") then
return [[Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.]]
end
return [[Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.
Before executing the command, please follow these steps:
@@ -154,6 +161,7 @@ EOF
Important:
- Return an empty response - the user will see the gh output directly
- Never update git config]]
end
---@type AvanteLLMToolParam
M.param = {