Skip to content

Commit 88684ac

Browse files
committed
Give Gemini some tips for calling tools
1 parent 489ddf4 commit 88684ac

File tree

1 file changed

+90
-2
lines changed

1 file changed

+90
-2
lines changed

.agents/base2/base2.ts

Lines changed: 90 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export function createBase2(
2424
const isMax = mode === 'max'
2525

2626
const isSonnet = !withGemini
27+
const isGemini = withGemini
2728

2829
return {
2930
publisher,
@@ -71,8 +72,8 @@ export function createBase2(
7172
!withGemini && isMax && 'editor-best-of-n-gpt-5',
7273
!withGemini && isDefault && 'thinker-best-of-n',
7374
!withGemini && isMax && 'thinker-best-of-n-gpt-5',
74-
isDefault && 'code-reviewer',
75-
isMax && 'code-reviewer-best-of-n-gpt-5',
75+
!withGemini && isDefault && 'code-reviewer',
76+
!withGemini && isMax && 'code-reviewer-best-of-n-gpt-5',
7677
'context-pruner',
7778
),
7879

@@ -155,6 +156,93 @@ ${buildArray(
155156
`- **Don't create a summary markdown file:** The user doesn't want markdown files they didn't ask for. Don't create them.`,
156157
'- **Keep final summary extremely concise:** Write only a few words for each change you made in the final summary.',
157158
).join('\n')}
159+
${
160+
isGemini
161+
? `
162+
## Note on tool call formatting
163+
164+
Later on, there is a more complete explanation of how to call tools.
165+
166+
Some quick gotchas:
167+
168+
1. **Don't include a trailing comma after the last parameter.**
169+
<codebuff_tool_call>
170+
{
171+
"cb_tool_name": "tool_name",
172+
"parameter_name": "value", <- Don't include a trailing comma after the last parameter.
173+
}
174+
</codebuff_tool_call>
175+
176+
2. Don't call multiple tools in a single tool call.
177+
178+
Don't do this:
179+
180+
<codebuff_tool_call>
181+
{
182+
"cb_tool_name": "tool_name_1",
183+
"parameter_name_1": "value",
184+
"cb_tool_name": "tool_name_2",
185+
"parameter_name_2": "value",
186+
}
187+
</codebuff_tool_call>
188+
189+
Do this:
190+
191+
<codebuff_tool_call>
192+
{
193+
"cb_tool_name": "tool_name_1",
194+
"parameter_name_1": "value",
195+
}
196+
</codebuff_tool_call>
197+
198+
<codebuff_tool_call>
199+
{
200+
"cb_tool_name": "tool_name_2",
201+
"parameter_name_2": "value",
202+
}
203+
</codebuff_tool_call>
204+
205+
3. Every response message should include at least one tool call, except for your last.
206+
207+
Don't do this:
208+
209+
I will read some files.
210+
211+
Do this:
212+
213+
I will read some files:
214+
215+
<codebuff_tool_call>
216+
[ Read files tool call json ]
217+
</codebuff_tool_call>
218+
219+
4. Agents are not tools. Call them using the spawn_agents tool.
220+
221+
Don't do this:
222+
223+
<codebuff_tool_call>
224+
{
225+
"cb_tool_name": "agent-name",
226+
"prompt": "[your prompt here]",
227+
}
228+
</codebuff_tool_call>
229+
230+
Do this:
231+
232+
<codebuff_tool_call>
233+
{
234+
"cb_tool_name": "spawn_agents",
235+
"agents": [
236+
{
237+
"agent_type": "agent-name",
238+
"prompt": "[your prompt here]",
239+
}
240+
],
241+
"cb_easp": true
242+
}
243+
</codebuff_tool_call>`
244+
: ''
245+
}
158246
159247
${PLACEHOLDER.FILE_TREE_PROMPT_SMALL}
160248
${PLACEHOLDER.KNOWLEDGE_FILES_CONTENTS}

0 commit comments

Comments
 (0)