Skip to content

Commit bc32f8c

Browse files
committed
feat(gemini_search): improve search instructions for clarity
I am updating the instructions for the `gemini_search` tool to make them more explicit and user-friendly. The previous instructions were a bit dense and could lead to confusion. The updated instructions clearly define the AI's role, emphasize the required `query` parameter, and provide clearer guidance on when and how to use the optional `start_time` and `end_time` parameters, including a concrete example. This should help ensure more accurate and effective use of the search tool.
1 parent 356102f commit bc32f8c

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

prompt_handlers.go

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,29 @@ func createTaskInstructions(problemStatement, systemPrompt string) string {
2323

2424
// createSearchInstructions generates instructions for gemini_search tool
2525
func createSearchInstructions(problemStatement string) string {
26-
return fmt.Sprintf(`Use the 'gemini_search' tool for this research task.
26+
return fmt.Sprintf(`You are an AI assistant. Your task is to answer the user's question by generating a call to the 'gemini_search' tool.
2727
28-
Parameter selection guide:
29-
1. query (always required): Create a focused search query from the problem statement
30-
2. start_time + end_time (conditional): Set both when problem implies time-sensitive information
31-
- Format: "YYYY-MM-DDTHH:MM:SSZ"
32-
3. Other parameters: Use defaults unless specifically needed
28+
Read the user's question below and then create a 'gemini_search' tool call.
3329
34-
Example:
35-
INPUT: "Who won Wimbledon this year?"
36-
OUTPUT: gemini_search(
37-
query="Wimbledon winner 2025",
38-
start_time="2025-01-01T00:00:00Z",
39-
end_time="2025-12-31T23:59:59Z"
40-
)
30+
**User's Question:**
31+
"%s"
32+
33+
**Instructions for the 'gemini_search' tool:**
34+
35+
* **'query' parameter (required):** Create a search query from the user's question.
36+
* **'start_time' and 'end_time' parameters (optional):**
37+
* Use these only if the question is about a specific time period (e.g., "this year", "last month", "in 2023").
38+
* If you use them, you must provide both 'start_time' and 'end_time'.
39+
* The format is "YYYY-MM-DDTHH:MM:SSZ".
40+
41+
**Example:**
42+
43+
If the user's question is: "What were the most popular movies of 2023?"
44+
45+
Your response should be the following tool call:
46+
'gemini_search(query="most popular movies of 2023", start_time="2023-01-01T00:00:00Z", end_time="2023-12-31T23:59:59Z")'
4147
42-
Problem statement:
43-
%s`, problemStatement)
48+
Now, generate the 'gemini_search' tool call for the user's question.`, problemStatement)
4449
}
4550

4651
// promptHandler is the generic handler for all prompts

0 commit comments

Comments
 (0)