Skip to content

Commit 679f45d

Browse files
claudegary149
authored andcommitted
Broaden tool-use guidance to cover capability-based tools
The previous wording ("requires external or real-time data") was too narrow and could suppress legitimate tool calls like image generation or code execution. Reword to "requires capabilities you lack (e.g., real-time data, image generation, code execution) or external information you do not have". Addresses review feedback in PR #2155. https://claude.ai/code/session_0151FUrN7XkXeS4FNhB9mz4C
1 parent f02ca89 commit 679f45d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/server/textGeneration/utils/toolPrompt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function buildToolPreprompt(tools: OpenAiTool[]): string {
1616
return [
1717
`You have access to these tools: ${names.join(", ")}.`,
1818
`Today's date: ${currentDate} (${isoDate}).`,
19-
`IMPORTANT: Do NOT call a tool unless the user's request requires external or real-time data you do not have. For tasks like writing code, creative writing, math, or building apps, respond directly without tools. When in doubt, do not use a tool.`,
19+
`IMPORTANT: Do NOT call a tool unless the user's request requires capabilities you lack (e.g., real-time data, image generation, code execution) or external information you do not have. For tasks like writing code, creative writing, math, or building apps, respond directly without tools. When in doubt, do not use a tool.`,
2020
`PARALLEL TOOL CALLS: When multiple tool calls are needed and they are independent of each other (i.e., one does not need the result of another), call them all at once in a single response instead of one at a time. Only chain tool calls sequentially when a later call depends on an earlier call's output.`,
2121
`SEARCH: Use 3-6 precise keywords. For historical events, include the year the event occurred. For recent or current topics, use today's year (${now.getFullYear()}). When a tool accepts date-range parameters (e.g., startPublishedDate, endPublishedDate), always use today's date (${isoDate}) as the end date unless the user specifies otherwise. For multi-part questions, search each part separately.`,
2222
`ANSWER: State only facts explicitly in the results. If info is missing or results conflict, say so. Never fabricate URLs or facts.`,

0 commit comments

Comments
 (0)