@@ -2,58 +2,56 @@ import { getToolUseGuidelinesSection } from "../tool-use-guidelines"
22import { EXPERIMENT_IDS } from "../../../../shared/experiments"
33
44describe ( "getToolUseGuidelinesSection" , ( ) => {
5- describe ( "native-only" , ( ) => {
6- describe ( "with MULTIPLE_NATIVE_TOOL_CALLS disabled (default)" , ( ) => {
7- it ( "should include proper numbered guidelines" , ( ) => {
8- const guidelines = getToolUseGuidelinesSection ( )
5+ describe ( "with MULTIPLE_NATIVE_TOOL_CALLS disabled (default)" , ( ) => {
6+ it ( "should include proper numbered guidelines" , ( ) => {
7+ const guidelines = getToolUseGuidelinesSection ( )
98
10- // Check that all numbered items are present with correct numbering
11- expect ( guidelines ) . toContain ( "1. Assess what information" )
12- expect ( guidelines ) . toContain ( "2. Choose the most appropriate tool" )
13- expect ( guidelines ) . toContain ( "3. If multiple actions are needed" )
14- expect ( guidelines ) . toContain ( "4. After each tool use" )
15- } )
9+ // Check that all numbered items are present with correct numbering
10+ expect ( guidelines ) . toContain ( "1. Assess what information" )
11+ expect ( guidelines ) . toContain ( "2. Choose the most appropriate tool" )
12+ expect ( guidelines ) . toContain ( "3. If multiple actions are needed" )
13+ expect ( guidelines ) . toContain ( "4. After each tool use" )
14+ } )
1615
17- it ( "should include single-tool-per-message guidance when experiment disabled" , ( ) => {
18- const guidelines = getToolUseGuidelinesSection ( { } )
16+ it ( "should include single-tool-per-message guidance when experiment disabled" , ( ) => {
17+ const guidelines = getToolUseGuidelinesSection ( { } )
1918
20- expect ( guidelines ) . toContain ( "use one tool at a time per message" )
21- expect ( guidelines ) . not . toContain ( "you may use multiple tools in a single message" )
22- expect ( guidelines ) . not . toContain ( "Formulate your tool use using" )
23- expect ( guidelines ) . toContain ( "ALWAYS wait for user confirmation" )
24- } )
19+ expect ( guidelines ) . toContain ( "use one tool at a time per message" )
20+ expect ( guidelines ) . not . toContain ( "you may use multiple tools in a single message" )
21+ expect ( guidelines ) . not . toContain ( "Formulate your tool use using" )
22+ expect ( guidelines ) . toContain ( "ALWAYS wait for user confirmation" )
23+ } )
2524
26- it ( "should include simplified iterative process guidelines" , ( ) => {
27- const guidelines = getToolUseGuidelinesSection ( )
25+ it ( "should include simplified iterative process guidelines" , ( ) => {
26+ const guidelines = getToolUseGuidelinesSection ( )
2827
29- expect ( guidelines ) . toContain ( "carefully considering the user's response after each tool use" )
30- expect ( guidelines ) . toContain ( "It is crucial to proceed step-by-step" )
31- } )
28+ expect ( guidelines ) . toContain ( "carefully considering the user's response after each tool use" )
29+ expect ( guidelines ) . toContain ( "It is crucial to proceed step-by-step" )
3230 } )
31+ } )
3332
34- describe ( "with MULTIPLE_NATIVE_TOOL_CALLS enabled" , ( ) => {
35- it ( "should include multiple-tools-per-message guidance when experiment enabled" , ( ) => {
36- const guidelines = getToolUseGuidelinesSection ( {
37- [ EXPERIMENT_IDS . MULTIPLE_NATIVE_TOOL_CALLS ] : true ,
38- } )
39-
40- expect ( guidelines ) . toContain ( "you may use multiple tools in a single message" )
41- expect ( guidelines ) . not . toContain ( "use one tool at a time per message" )
42- expect ( guidelines ) . not . toContain ( "After each tool use, the user will respond" )
33+ describe ( "with MULTIPLE_NATIVE_TOOL_CALLS enabled" , ( ) => {
34+ it ( "should include multiple-tools-per-message guidance when experiment enabled" , ( ) => {
35+ const guidelines = getToolUseGuidelinesSection ( {
36+ [ EXPERIMENT_IDS . MULTIPLE_NATIVE_TOOL_CALLS ] : true ,
4337 } )
4438
45- it ( "should use simplified footer without step-by-step language" , ( ) => {
46- const guidelines = getToolUseGuidelinesSection ( {
47- [ EXPERIMENT_IDS . MULTIPLE_NATIVE_TOOL_CALLS ] : true ,
48- } )
39+ expect ( guidelines ) . toContain ( "you may use multiple tools in a single message" )
40+ expect ( guidelines ) . not . toContain ( "use one tool at a time per message" )
41+ expect ( guidelines ) . not . toContain ( "After each tool use, the user will respond" )
42+ } )
4943
50- // When multiple tools per message is enabled, we don't want the
51- // "step-by-step" or "after each tool use" language that would
52- // contradict the ability to batch tool calls.
53- expect ( guidelines ) . toContain ( "carefully considering the user's response after tool executions" )
54- expect ( guidelines ) . not . toContain ( "It is crucial to proceed step-by-step" )
55- expect ( guidelines ) . not . toContain ( "ALWAYS wait for user confirmation after each tool use" )
44+ it ( "should use simplified footer without step-by-step language" , ( ) => {
45+ const guidelines = getToolUseGuidelinesSection ( {
46+ [ EXPERIMENT_IDS . MULTIPLE_NATIVE_TOOL_CALLS ] : true ,
5647 } )
48+
49+ // When multiple tools per message is enabled, we don't want the
50+ // "step-by-step" or "after each tool use" language that would
51+ // contradict the ability to batch tool calls.
52+ expect ( guidelines ) . toContain ( "carefully considering the user's response after tool executions" )
53+ expect ( guidelines ) . not . toContain ( "It is crucial to proceed step-by-step" )
54+ expect ( guidelines ) . not . toContain ( "ALWAYS wait for user confirmation after each tool use" )
5755 } )
5856 } )
5957
0 commit comments