refactor: rename thinking => think (#2247)
This commit is contained in:
@@ -1052,7 +1052,7 @@ You can delete the first file by providing a path of "directory1/a/something.txt
|
||||
},
|
||||
},
|
||||
},
|
||||
require("avante.llm_tools.thinking"),
|
||||
require("avante.llm_tools.think"),
|
||||
require("avante.llm_tools.get_diagnostics"),
|
||||
require("avante.llm_tools.bash"),
|
||||
require("avante.llm_tools.attempt_completion"),
|
||||
|
||||
@@ -6,10 +6,14 @@ local Utils = require("avante.utils")
|
||||
---@class AvanteLLMTool
|
||||
local M = setmetatable({}, Base)
|
||||
|
||||
M.name = "thinking"
|
||||
M.name = "think"
|
||||
|
||||
M.description =
|
||||
"A tool for thinking through problems, brainstorming ideas, or planning without executing any actions. Use this tool when you need to work through complex problems, develop strategies, or outline approaches before taking action."
|
||||
[[Use the tool to think about something. It will not obtain new information or make any changes to the repository, but just log the thought. Use it when complex reasoning or brainstorming is needed. For example, if you explore the repo and discover the source of a bug, call this tool to brainstorm several unique ways of fixing the bug, and assess which change(s) are likely to be simplest and most effective. Alternatively, if you receive some test results, call this tool to brainstorm ways to fix the failing tests.
|
||||
|
||||
RULES:
|
||||
- Remember to frequently use the `think` tool to resolve tasks, especially before each tool call.
|
||||
]]
|
||||
|
||||
M.support_streaming = true
|
||||
|
||||
@@ -18,8 +22,8 @@ M.param = {
|
||||
type = "table",
|
||||
fields = {
|
||||
{
|
||||
name = "content",
|
||||
description = "Content to think about. This should be a description of what to think about or a problem to solve.",
|
||||
name = "thought",
|
||||
description = "Your thoughts.",
|
||||
type = "string",
|
||||
},
|
||||
},
|
||||
@@ -40,7 +44,7 @@ M.returns = {
|
||||
}
|
||||
|
||||
---@class ThinkingInput
|
||||
---@field content string
|
||||
---@field thought string
|
||||
|
||||
---@type avante.LLMToolOnRender<ThinkingInput>
|
||||
function M.on_render(opts, _, state)
|
||||
@@ -48,7 +52,7 @@ function M.on_render(opts, _, state)
|
||||
local text = state == "generating" and "Thinking" or "Thoughts"
|
||||
table.insert(lines, Line:new({ { Utils.icon("🤔 ") .. text, Highlights.AVANTE_THINKING } }))
|
||||
table.insert(lines, Line:new({ { "" } }))
|
||||
local content = opts.content or ""
|
||||
local content = opts.thought or ""
|
||||
local text_lines = vim.split(content, "\n")
|
||||
for _, text_line in ipairs(text_lines) do
|
||||
table.insert(lines, Line:new({ { "> " .. text_line } }))
|
||||
Reference in New Issue
Block a user