Skip to content

Commit e7a36ea

Browse files
committed
refactor: simplify getAttemptCompletionDescription by removing unnecessary variables
1 parent 18f05e6 commit e7a36ea

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
11
import { ToolArgs } from "./types"
22

33
export function getAttemptCompletionDescription(args?: ToolArgs): string {
4-
const baseDescription = `## attempt_completion
4+
return `## attempt_completion
55
Description: After each tool use, the user will respond with the result of that tool use, i.e. if it succeeded or failed, along with any reasons for failure. Once you've received the results of tool uses and can confirm that the task is complete, use this tool to present the result of your work to the user. The user may respond with feedback if they are not satisfied with the result, which you can use to make improvements and try again.
66
IMPORTANT NOTE: This tool CANNOT be used until you've confirmed from the user that any previous tool uses were successful. Failure to do so will result in code corruption and system failure. Before using this tool, you must ask yourself in <thinking></thinking> tags if you've confirmed from the user that any previous tool uses were successful. If not, then DO NOT use this tool.
77
Parameters:
8-
- result: (required) The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance.`
9-
10-
const usage = `
8+
- result: (required) The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance.
119
Usage:
1210
<attempt_completion>
1311
<result>
1412
Your final result description here
1513
</result>
16-
</attempt_completion>`
17-
18-
const example = `
14+
</attempt_completion>
1915
2016
Example: Requesting to attempt completion with a result
2117
<attempt_completion>
2218
<result>
2319
I've updated the CSS
2420
</result>
2521
</attempt_completion>`
26-
27-
return baseDescription + usage + example
2822
}

0 commit comments

Comments
 (0)