agent2: Port read_file tool (#35840)
Ports the read_file tool from `assistant_tools` to `agent2`. Note: Image support not implemented. Release Notes: - N/A
This commit is contained in:
parent
7d4d8b8398
commit
3d662ee282
6 changed files with 1011 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
use crate::{templates::Templates, AgentResponseEvent, Thread};
|
||||
use crate::{FindPathTool, ThinkingTool, ToolCallAuthorization};
|
||||
use crate::{FindPathTool, ReadFileTool, ThinkingTool, ToolCallAuthorization};
|
||||
use acp_thread::ModelSelector;
|
||||
use agent_client_protocol as acp;
|
||||
use anyhow::{anyhow, Context as _, Result};
|
||||
|
@ -413,9 +413,10 @@ impl acp_thread::AgentConnection for NativeAgentConnection {
|
|||
})?;
|
||||
|
||||
let thread = cx.new(|_| {
|
||||
let mut thread = Thread::new(project.clone(), agent.project_context.clone(), action_log, agent.templates.clone(), default_model);
|
||||
let mut thread = Thread::new(project.clone(), agent.project_context.clone(), action_log.clone(), agent.templates.clone(), default_model);
|
||||
thread.add_tool(ThinkingTool);
|
||||
thread.add_tool(FindPathTool::new(project.clone()));
|
||||
thread.add_tool(ReadFileTool::new(project.clone(), action_log));
|
||||
thread
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue