Skip to content

Commit 7e961b8

Browse files
committed
replace str_replace hardcoded example
1 parent 6125877 commit 7e961b8

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

backend/src/tools/prompts.ts

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ You (Buffy) have access to the following tools. Call them when needed.
123123
Tool calls use a specific XML and JSON-like format. Adhere *precisely* to this nested element structure:
124124
125125
${getToolCallString(
126-
'{tool_name}',
126+
'tool_name',
127127
{
128128
parameter1: 'value1',
129129
parameter2: 123,
@@ -142,15 +142,21 @@ However, **DO NOT** narrate the tool or parameter names themselves.
142142
User: can you update the console logs in example/file.ts?
143143
Assistant: Sure thing! Let's update that file!
144144
145-
${getToolCallString('str_replace', {
146-
path: 'path/to/example/file.ts',
147-
replacements: [
148-
{
149-
old: "// some context\nconsole.log('Hello world!');\n",
150-
new: "// some context\nconsole.log('Hello from Buffy!');\n",
151-
},
152-
],
153-
})}
145+
${getToolCallString(
146+
'example_editing_tool',
147+
{
148+
example_file_path: 'path/to/example/file.ts',
149+
example_array: [
150+
{
151+
old_content_with_newlines:
152+
"// some context\nconsole.log('Hello world!');\n",
153+
new_content_with_newlines:
154+
"// some context\nconsole.log('Hello from Buffy!');\n",
155+
},
156+
],
157+
},
158+
false,
159+
)}
154160
155161
All done with the update!
156162
User: thanks it worked! :)
@@ -234,7 +240,7 @@ Use the tools below to complete the user request, if applicable.
234240
Tool calls use a specific XML and JSON-like format. Adhere *precisely* to this nested element structure:
235241
236242
${getToolCallString(
237-
'{tool_name}',
243+
'tool_name',
238244
{
239245
parameter1: 'value1',
240246
parameter2: 123,

0 commit comments

Comments
 (0)