diff --git a/src/main/presenter/builtInToolsPresenter/executeCommandTool.ts b/src/main/presenter/builtInToolsPresenter/executeCommandTool.ts
index d0fd460126d64e715967595278e85f345b5eae6a..8ee5ffedd87a92e19fa0e4f62ce5e39668ab2125 100644
--- a/src/main/presenter/builtInToolsPresenter/executeCommandTool.ts
+++ b/src/main/presenter/builtInToolsPresenter/executeCommandTool.ts
@@ -9,7 +9,7 @@ const execAsync = promisify(execCallback)
export const executeCommandTool: BuiltInToolDefinition = {
name: 'execute_command',
description:
- 'Executes a command-line command in the current or specified working directory, and returns standard output and standard error.',
+ "Requests the execution of a command line instruction and returns the standard output and standard error. Use this tool only when needing to run commands related to the system itself; it cannot be used for network requests or accessing external websites. That is, use it only when there is a clear need, and carefully evaluate the potential side effects of the command. You must tailor the command to the user's system and clearly explain its function. For command chaining, use the appropriate chaining syntax for the user's shell. By default, it runs in the current working directory; other directories or shells can be specified as needed.This tool can only be run on the local system where it is installed. When performing operations such as package installation and uninstallation, it is necessary to first determine the correct package management command.",
parameters: {
type: 'object',
properties: {
@@ -20,16 +20,17 @@ export const executeCommandTool: BuiltInToolDefinition = {
working_directory: {
type: 'string',
description:
- 'The working directory to use when executing the command (optional; the current process directory is the default).'
+ 'The directory to use when executing the command. When the path is necessary, confirm with the user.'
},
timeout: {
type: 'number',
- description: 'Maximum time the command is allowed to run (milliseconds, default 30000)。'
+ description:
+ 'The maximum allowed runtime for the command in milliseconds, number type. Leave empty for the default of 30000.'
},
shell: {
type: 'string',
description:
- 'The shell to use to execute the command (optional; if left blank, the system default is used)。'
+ 'The shell used to execute the command, eg \`powershell.exe\`?\`bash\`, Leave empty to use the system default.?'
}
},
required: ['command']
diff --git a/src/main/presenter/builtInToolsPresenter/listFilesTool.ts b/src/main/presenter/builtInToolsPresenter/listFilesTool.ts
index 55c1c6b7c3c0d1884abe13140b30bcf8112b70f6..9a27dc3b09957f231793b1d95803b640b871168c 100644
--- a/src/main/presenter/builtInToolsPresenter/listFilesTool.ts
+++ b/src/main/presenter/builtInToolsPresenter/listFilesTool.ts
@@ -4,17 +4,20 @@ import { BuiltInToolDefinition, BuiltInToolResponse, buildRawData } from './base
export const listFilesTool: BuiltInToolDefinition = {
name: 'list_files',
- description: 'List files and directories in the specified directory',
+ description:
+ 'equests to list the names of files and subdirectories in a specified directory. Use this tool when you need to understand the directory structure or confirm the existence of files. By default, it only lists the current level, recursion can be enabled if necessary.',
parameters: {
type: 'object',
properties: {
directory_path: {
type: 'string',
- description: 'Directory path to list content'
+ description:
+ 'The path of the directory to list (When the path is uncertain, confirm with the user).'
},
recursive: {
type: 'boolean',
- description: 'Whether to recursively list subdirectories',
+ description:
+ 'Whether to recursively list subdirectories, boolean type, defaults to false. Set to true only when the complete directory tree is genuinely needed to avoid excessive output.',
default: false
}
},
diff --git a/src/main/presenter/builtInToolsPresenter/readFileTool.ts b/src/main/presenter/builtInToolsPresenter/readFileTool.ts
index 36872770deb2721a445d74ee9f3a9d265dbe59aa..0d1df1744c5c0b6c70dba007d05c6b6c5a03bb14 100644
--- a/src/main/presenter/builtInToolsPresenter/readFileTool.ts
+++ b/src/main/presenter/builtInToolsPresenter/readFileTool.ts
@@ -4,13 +4,15 @@ import { BuiltInToolDefinition, BuiltInToolResponse, buildRawData } from './base
export const readFileTool: BuiltInToolDefinition = {
name: 'read_file',
- description: 'Read the contents of a file at a specified path',
+ description:
+ 'Requests to read the content of a file at a specified path. Use this tool when you need to inspect an existing file whose content you are unaware of, such as analyzing code, viewing a text file, or extracting information from a configuration file.The output content will have line numbers prefixed to each line (e.g., "1 | const x = 1"), making it easier to reference specific lines when creating diffs or discussing code. It can automatically extract raw text from PDF and DOCX files. It might not work for other types of binary files as it returns the raw content as a string.',
parameters: {
type: 'object',
properties: {
file_path: {
type: 'string',
- description: 'The path to the file to read, either absolute or relative'
+ description:
+ 'The path of the file to read (When the path is uncertain, confirm with the user).'
},
encoding: {
type: 'string',
@@ -77,7 +79,7 @@ export async function executeReadFileTool(
}
} catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error)
- const failureMessage = `读取文件失败: ${errorMessage}`
+ const failureMessage = `Read file failures: ${errorMessage}`
const metadata = { error: errorMessage }
return {
toolCallId,
diff --git a/src/main/presenter/builtInToolsPresenter/writeFileTool.ts b/src/main/presenter/builtInToolsPresenter/writeFileTool.ts
index 29842561593d99eed1058abd7fceb72a33d97cf8..18e7269e5c09a55926ecd65128ca81ba7af15a38 100644
--- a/src/main/presenter/builtInToolsPresenter/writeFileTool.ts
+++ b/src/main/presenter/builtInToolsPresenter/writeFileTool.ts
@@ -4,18 +4,20 @@ import { BuiltInToolDefinition, BuiltInToolResponse, buildRawData } from './base
export const writeFileTool: BuiltInToolDefinition = {
name: 'write_file',
- description: 'Write the content into a file in the specified path',
+ description:
+ 'Requests to write the complete content to a file at a specified path. If the file already exists, it will be overwritten with the provided content. If the file does not exist, a new file will be created. This tool automatically creates all necessary directories required to write the file.',
parameters: {
type: 'object',
properties: {
file_path: {
type: 'string',
description:
- 'The file path to be written can be either an absolute path or a relative path.'
+ 'The path of the file to write to (When the path is uncertain, confirm with the user).'
},
content: {
type: 'string',
- description: 'The content to be written into the file'
+ description:
+ 'The content to write to the file. Always provide the complete intended content of the file, without any truncation or omission. You must include all parts of the file, even if they are unmodified. However, do not include line numbers in the content, only provide the actual content of the file.'
},
encoding: {
type: 'string',
diff --git a/src/main/presenter/configPresenter/index.ts b/src/main/presenter/configPresenter/index.ts
index d848d31c01bbe13f8ce79f1238f0052ee0851a17..6ab07ee1ff64219632b046a5f9b46b134327c45e 100644
--- a/src/main/presenter/configPresenter/index.ts
+++ b/src/main/presenter/configPresenter/index.ts
@@ -127,7 +127,7 @@ export class ConfigPresenter implements IConfigPresenter {
lastSyncTime: 0,
soundEnabled: false,
copyWithCotEnabled: true,
- useBuiltInToolsEnabled: false,
+ useBuiltInToolsEnabled: true,
loggingEnabled: false,
floatingButtonEnabled: false,
default_system_prompt: '',
diff --git a/src/main/presenter/promptPresenter/sections/index.ts b/src/main/presenter/promptPresenter/sections/index.ts
index 88d77eb1c86a66b3ae1d66262e5233f3083d1755..0a571904dfc3aa93e6a88edd2e5251e63758764f 100644
--- a/src/main/presenter/promptPresenter/sections/index.ts
+++ b/src/main/presenter/promptPresenter/sections/index.ts
@@ -2,6 +2,4 @@ export { getSystemInfoSection } from './system-info'
export { getObjectiveSection } from './objective'
export { addCustomInstructions } from './custom-instructions'
export { getSharedToolUseSection } from './tool-use'
-export { getToolDescriptionsSection } from './tool-descriptions'
-export { getToolUseGuidelinesSection } from './tool-use-guidelines'
export { markdownFormattingSection } from './markdown-formatting'
diff --git a/src/main/presenter/promptPresenter/sections/tool-descriptions.ts b/src/main/presenter/promptPresenter/sections/tool-descriptions.ts
deleted file mode 100644
index 7315d50c45413113cff4fcaddc578f7e9859ede7..0000000000000000000000000000000000000000
--- a/src/main/presenter/promptPresenter/sections/tool-descriptions.ts
+++ /dev/null
@@ -1,118 +0,0 @@
-export function getToolDescriptionsSection(): string {
- return `# Tool Descriptions
-
-## read_file
-Description: Requests to read the content of a file at a specified path.
-Use this tool when you need to inspect an existing file whose content you are unaware of, such as analyzing code, viewing a text file, or extracting information from a configuration file.
-The output content will have line numbers prefixed to each line (e.g., "1 | const x = 1"), making it easier to reference specific lines when creating diffs or discussing code.
-It can automatically extract raw text from PDF and DOCX files. It might not work for other types of binary files as it returns the raw content as a string.
-Parameters:
-- file_path:(Required) The path of the file to read (When the path is uncertain, confirm with the user).
-Usage:
-
-
-Fill in the file path here
-
-
-
-Example: Request to read the frontend-config.json file
-
-
-frontend-config.json
-
-
-
-## write_file
-Description: Requests to write the complete content to a file at a specified path. If the file already exists, it will be overwritten with the provided content.
-If the file does not exist, a new file will be created. This tool automatically creates all necessary directories required to write the file.
-Parameters:
-- file_path: (Required) The path of the file to write to (When the path is uncertain, confirm with the user).
-- content: (Required) The content to write to the file. Always provide the complete intended content of the file, without any truncation or omission. You must include all parts of the file, even if they are unmodified. However, do not include line numbers in the content, only provide the actual content of the file.
-- line_count: (Required) The number of lines in the file. Ensure this count is based on the actual content of the file, not the number of lines in the content you provide.
-Usage:
-
-
-Fill in the file path here
-
-Fill in the file content here
-
-Total number of lines in the file, including empty lines
-
-
-
-Example: Request to write to frontend-config.json
-
-
-frontend-config.json
-
-{
- "apiEndpoint": "https://api.example.com",
- "theme": {
- "primaryColor": "#007bff",
- "secondaryColor": "#6c757d",
- "fontFamily": "Arial, sans-serif"
- },
- "features": {
- "darkMode": true,
- "notifications": true,
- "analytics": false
- },
- "version": "1.0.0"
-}
-
-14
-
-
-
-## list_files
-Description: Requests to list the names of files and subdirectories in a specified directory.
-Use this tool when you need to understand the directory structure or confirm the existence of files.
-By default, it only lists the current level, recursion can be enabled if necessary.
-Parameters:
-- directory_path: (Required) The path of the directory to list (When the path is uncertain, confirm with the user).
-- recursive: (Optional) Whether to recursively list subdirectories, boolean type, defaults to false. Set to true only when the complete directory tree is genuinely needed to avoid excessive output.
-Usage:
-
-
-Fill in the directory path here
-false
-
-
-
-Example: Request to list the src/main directory
-
-
-src/main
-false
-
-
-
-## execute_command
-Description: Requests the execution of a command line instruction and returns the standard output and standard error. Use this tool only when needing to run commands related to the system itself; it cannot be used for network requests or accessing external websites.
-That is, use it only when there is a clear need, and carefully evaluate the potential side effects of the command. You must tailor the command to the user's system and clearly explain its function. For command chaining, use the appropriate chaining syntax for the user's shell.
-By default, it runs in the current working directory; other directories or shells can be specified as needed.
-This tool can only be run on the local system where it is installed. When performing operations such as package installation and uninstallation, it is necessary to first determine the correct package management command.
-Parameters:
-- command: (Required) The complete command string to execute.
-- working_directory: (Optional) The directory to use when executing the command. When the path is necessary, confirm with the user.
-- timeout: (Optional) The maximum allowed runtime for the command in milliseconds, number type. Leave empty for the default of 30000.
-- shell: (Optional) The shell used to execute the command, eg \`powershell.exe\`、\`bash\`, Leave empty to use the system default.。
-Usage:
-
-
-Fill in the command here
-Optional working directory
-30000
-Optional shell
-
-
-
-Example: Check Node.js version
-
-
-node -v
-5000
-
-
-`
-}
diff --git a/src/main/presenter/promptPresenter/sections/tool-use-guidelines.ts b/src/main/presenter/promptPresenter/sections/tool-use-guidelines.ts
deleted file mode 100644
index e9af01b4b2fe5b6b81d32558a8c2f81b63d84dd6..0000000000000000000000000000000000000000
--- a/src/main/presenter/promptPresenter/sections/tool-use-guidelines.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-export function getToolUseGuidelinesSection(): string {
- return `# Tool Use Guidelines
-
-1. Analyze user intent, determine whether to call the tool based on its description, and select the most matching tool or tools.
-2. Assess what information you already have ,and proactively and clearly inquire about missing necessary parameters to ensure that the format of the call request fully complies with the tool interface specifications.
-3. If multiple actions are needed, use one tool at a time per message to accomplish the task iteratively, with each tool use being informed by the result of the previous tool use. Each step must be informed by the previous step's result.
-4. Formulate your tool use using the XML format specified for each tool.
-5. Properly handle any errors in tool calls, convert them into user-friendly prompts that users can understand, and do not expose technical details.
-6. ALWAYS wait for user confirmation after each tool use before proceeding. Never assume the success of a tool use without explicit confirmation of the result from the user.
-
-It is crucial to proceed step-by-step, waiting for the user's message after each tool use before moving forward with the task. This approach allows you to:
-1. Confirm the success of each step before proceeding.
-2. Address any issues or errors that arise immediately.
-3. Adapt your approach based on new information or unexpected results.
-4. Ensure that each action builds correctly on the previous ones.
-
-By waiting for and carefully considering the user's response after each tool use, you can react accordingly and make informed decisions about how to proceed with the task. This iterative process helps ensure the overall success and accuracy of your work.`
-}
diff --git a/src/renderer/src/stores/settings.ts b/src/renderer/src/stores/settings.ts
index c63987146997aa68e4e88aa85310d80056c2b3fa..84ed2f675c7387233f427195b43223b9be0cdd7d 100644
--- a/src/renderer/src/stores/settings.ts
+++ b/src/renderer/src/stores/settings.ts
@@ -33,7 +33,7 @@ export const useSettingsStore = defineStore('settings', () => {
const searchPreviewEnabled = ref(true) // 搜索预览是否启用,默认启用
const contentProtectionEnabled = ref(true) // 投屏保护是否启用,默认启用
const copyWithCotEnabled = ref(true)
- const useBuiltInToolsEnabled = ref(false) // 内置工具是否启用,默认不启用
+ const useBuiltInToolsEnabled = ref(true) // 内置工具是否启用,默认启用
const notificationsEnabled = ref(true) // 系统通知是否启用,默认启用
const fontSizeLevel = ref(DEFAULT_FONT_SIZE_LEVEL) // 字体大小级别,默认为 1
// Ollama 相关状态