fix: copilot tool description cannot use long text (#1722)

This commit is contained in:
yetone
2025-03-26 14:47:51 +08:00
committed by GitHub
parent 39787969c7
commit 4c2dd777d6

View File

@@ -8,8 +8,13 @@ local M = setmetatable({}, Base)
M.name = "dispatch_agent"
M.description =
[[Launch a new agent that has access to the following tools: `glob`, `grep`, `ls`, `view`. When you are searching for a keyword or file and are not confident that you will find the right match on the first try, use the Agent tool to perform the search for you. For example:
M.get_description = function()
local provider = Providers[Config.provider]
if Config.provider:match("copilot") and provider.model and provider.model:match("gpt") then
return [[Launch a new agent that has access to the following tools: `glob`, `grep`, `ls`, `view`. When you are searching for a keyword or file and are not confident that you will find the right match on the first try, use the Agent tool to perform the search for you.]]
end
return [[Launch a new agent that has access to the following tools: `glob`, `grep`, `ls`, `view`. When you are searching for a keyword or file and are not confident that you will find the right match on the first try, use the Agent tool to perform the search for you. For example:
- If you are searching for a keyword like "config" or "logger", the Agent tool is appropriate
- If you want to read a specific file path, use the `view` or `glob` tool instead of the `dispatch_agent` tool, to find the match more quickly
@@ -21,6 +26,7 @@ Usage notes:
3. Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.
4. The agent's outputs should generally be trusted
5. IMPORTANT: The agent can not use `bash`, `write`, `str_replace`, so can not modify files. If you want to use these tools, use them directly instead of going through the agent.]]
end
---@type AvanteLLMToolParam
M.param = {