-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathscenarios.ts
More file actions
2150 lines (2083 loc) · 64.6 KB
/
scenarios.ts
File metadata and controls
2150 lines (2083 loc) · 64.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* Test scenarios for focused LLM tool usage evaluation
*/
import { ToolUsageScenario } from './types.js';
/**
* Comprehensive test scenarios focused on tool usage patterns
*/
export const TOOL_USAGE_SCENARIOS: ToolUsageScenario[] = [
// === DOCUMENT DISCOVERY TOOLS ===
// list_documents scenarios
{
id: 'simple-list',
description: 'List all documents',
query: 'Show me all available documents',
expectedTools: ['list_documents'],
maxToolCalls: 1,
},
{
id: 'list-with-limit',
description: 'List documents with limit',
query: 'Show me the first 5 documents',
expectedTools: ['list_documents'],
maxToolCalls: 1,
expectedParameters: {
list_documents: { limit: 5 },
},
},
{
id: 'list-sorted-by-title',
description: 'List documents sorted by title',
query: 'Show me all documents sorted alphabetically by title',
expectedTools: ['list_documents'],
maxToolCalls: 1,
expectedParameters: {
list_documents: { sort_by: 'title', sort_order: 'asc' },
},
},
{
id: 'list-with-title-filter',
description: 'List documents filtered by title',
query: 'Find documents with "contract" in the title',
expectedTools: ['list_documents'],
maxToolCalls: 1,
expectedParameters: {
list_documents: { title: 'contract' },
},
},
{
id: 'list-recent-with-count',
description: 'List recent documents with remaining count',
query: 'Show me the 10 most recently updated documents and tell me how many more there are',
expectedTools: ['list_documents'],
maxToolCalls: 1,
expectedParameters: {
list_documents: {
limit: 10,
sort_by: 'updated_at',
sort_order: 'desc',
count_remaining: true,
},
},
},
// read_document_info scenarios
{
id: 'simple-info',
description: 'Get document information',
query: 'Tell me about document doc-12345',
expectedTools: ['read_document_info'],
maxToolCalls: 1,
expectedParameters: {
read_document_info: {
document_fingerprint: { document_id: 'doc-12345' },
},
},
},
// === TEXT EXTRACTION TOOLS ===
// extract_text scenarios
{
id: 'simple-extract',
description: 'Extract text from specific page',
query: 'Extract text from page 2 of document doc-12345',
expectedTools: ['extract_text'],
maxToolCalls: 1,
expectedParameters: {
extract_text: {
document_fingerprint: { document_id: 'doc-12345' },
page_range: { start: 1, end: 1 },
},
},
},
{
id: 'extract-with-coordinates',
description: 'Extract text with position information',
query: 'Extract text from document doc-12345 and include the coordinate positions',
expectedTools: ['extract_text'],
maxToolCalls: 1,
expectedParameters: {
extract_text: {
document_fingerprint: { document_id: 'doc-12345' },
include_coordinates: true,
},
},
},
{
id: 'extract-page-range-with-ocr',
description: 'Extract text from page range with OCR',
query: 'Extract text from pages 3 to 4 of document doc-12345 using OCR for scanned content',
expectedTools: ['extract_text'],
maxToolCalls: 1,
expectedParameters: {
extract_text: {
document_fingerprint: { document_id: 'doc-12345' },
page_range: { start: 2, end: 3 },
ocr_enabled: true,
},
},
},
// search scenarios
{
id: 'simple-search',
description: 'Search for text in document',
query: 'Search for "confidential" in document doc-12345',
expectedTools: ['search'],
maxToolCalls: 1,
expectedParameters: {
search: {
document_fingerprint: { document_id: 'doc-12345' },
query: 'confidential',
},
},
},
{
id: 'regex-search-case-sensitive',
description: 'Regex search with case sensitivity',
query: 'Find all email addresses in document doc-12345 using regex, case sensitive search',
expectedTools: ['search'],
maxToolCalls: 1,
expectedParameters: {
search: {
document_fingerprint: { document_id: 'doc-12345' },
query: '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}',
search_type: 'regex',
case_sensitive: true,
},
},
},
{
id: 'search-page-range-with-annotations',
description: 'Search in specific pages including annotations',
query:
'Search for "important" in pages 2-4 of document doc-12345, including inside annotations',
expectedTools: ['search'],
maxToolCalls: 1,
expectedParameters: {
search: {
document_fingerprint: { document_id: 'doc-12345' },
query: 'important',
start_page: 1,
end_page: 3,
include_annotations: true,
},
},
},
{
id: 'preset-search-phone-numbers',
description: 'Search using preset for phone numbers',
query: 'Find all North American phone numbers in document doc-12345',
expectedTools: ['search'],
maxToolCalls: 1,
expectedParameters: {
search: {
document_fingerprint: { document_id: 'doc-12345' },
query: 'north-american-phone-number',
search_type: 'preset',
},
},
},
// render_document_page scenarios
{
id: 'render-page-with-width',
description: 'Render a document page with width parameter',
query: 'Show me page 1 of document doc-12345 as an image with width 800 pixels',
expectedTools: ['render_document_page'],
maxToolCalls: 1,
expectedParameters: {
render_document_page: {
document_fingerprint: { document_id: 'doc-12345' },
pages: [0],
width: 800,
},
},
},
{
id: 'render-page-with-height',
description: 'Render a document page with height parameter',
query: 'Render page 3 of document doc-12345 with a height of 600 pixels',
expectedTools: ['render_document_page'],
maxToolCalls: 1,
expectedParameters: {
render_document_page: {
document_fingerprint: { document_id: 'doc-12345' },
pages: [2],
height: 600,
},
},
},
{
id: 'render-first-page',
description: 'Render the first page of a document',
query: 'Show me the first page of document doc-12345 as an image',
expectedTools: ['render_document_page'],
maxToolCalls: 1,
expectedParameters: {
render_document_page: {
document_fingerprint: { document_id: 'doc-12345' },
pages: [0],
width: 800,
},
},
},
{
id: 'render-multiple-pages',
description: 'Render multiple pages of a document',
query: 'Show me pages 1, 3, and 5 of document doc-12345 as images with width 600 pixels',
expectedTools: ['render_document_page'],
maxToolCalls: 1,
expectedParameters: {
render_document_page: {
document_fingerprint: { document_id: 'doc-12345' },
pages: [0, 2, 4],
width: 600,
},
},
},
{
id: 'render-page-range',
description: 'Render a range of document pages',
query: 'Show me the first three pages of document doc-12345',
expectedTools: ['render_document_page'],
maxToolCalls: 1,
expectedParameters: {
render_document_page: {
document_fingerprint: { document_id: 'doc-12345' },
pages: [0, 1, 2],
width: 800,
},
},
},
// extract_tables scenarios
{
id: 'extract-all-tables',
description: 'Extract all tables from document',
query: 'Extract all tables from document doc-12345',
expectedTools: ['extract_tables'],
maxToolCalls: 1,
expectedParameters: {
extract_tables: { document_fingerprint: { document_id: 'doc-12345' } },
},
},
{
id: 'extract-tables-page-range',
description: 'Extract tables from specific pages',
query: 'Extract tables from pages 3 to 5 of document doc-12345',
expectedTools: ['extract_tables'],
maxToolCalls: 1,
expectedParameters: {
extract_tables: {
document_fingerprint: { document_id: 'doc-12345' },
page_range: { start: 2, end: 4 },
},
},
},
// === FORM TOOLS ===
// extract_form_data scenarios
{
id: 'extract-all-form-data',
description: 'Extract all form field data',
query: 'Show me all the form fields and their values in document doc-form-123',
expectedTools: ['extract_form_data'],
maxToolCalls: 1,
expectedParameters: {
extract_form_data: { document_fingerprint: { document_id: 'doc-form-123' } },
},
},
{
id: 'extract-specific-form-fields',
description: 'Extract specific form fields',
query: 'Get the values for the "name", "email", and "phone" fields from document doc-form-123',
expectedTools: ['extract_form_data'],
maxToolCalls: 1,
expectedParameters: {
extract_form_data: {
document_fingerprint: { document_id: 'doc-form-123' },
field_names: ['name', 'email', 'phone'],
},
},
},
{
id: 'extract-filled-form-fields-only',
description: 'Extract only filled form fields',
query: 'Show me only the form fields that have been filled out in document doc-form-123',
expectedTools: ['extract_form_data'],
maxToolCalls: 1,
expectedParameters: {
extract_form_data: {
document_fingerprint: { document_id: 'doc-form-123' },
include_empty_fields: false,
},
},
},
// fill_form_fields scenarios
{
id: 'fill-single-form-field',
description: 'Fill a single form field',
query: 'Fill the "name" field with "John Smith" in document doc-form-123',
expectedTools: ['fill_form_fields'],
maxToolCalls: 1,
expectedParameters: {
fill_form_fields: {
document_fingerprint: { document_id: 'doc-form-123' },
field_values: [{ fieldName: 'name', value: 'John Smith' }],
},
},
},
{
id: 'fill-multiple-form-fields',
description: 'Fill multiple form fields with different types',
query:
'Fill the form in document doc-form-123: set Name to "Jane Doe", zip code of 00000, and sex of male',
expectedTools: ['fill_form_fields'],
maxToolCalls: 1,
expectedParameters: {
fill_form_fields: {
document_fingerprint: { document_id: 'doc-form-123' },
field_values: [
{ fieldName: 'Name_First', value: 'Jane' },
{ fieldName: 'Name_Last', value: 'Doe' },
{ fieldName: 'ZIP', value: '00000' },
{ fieldName: 'Sex.0', value: 'On' },
],
},
},
},
{
id: 'fill-form-skip-validation',
description: 'Fill form fields without validation',
query:
'Fill the "custom_field" with "test value" in document doc-form-123, don\'t validate if the field exists',
expectedTools: ['fill_form_fields'],
maxToolCalls: 1,
expectedParameters: {
fill_form_fields: {
document_fingerprint: { document_id: 'doc-form-123' },
field_values: [{ fieldName: 'custom_field', value: 'test value' }],
validate_required: false,
},
},
},
// === ANNOTATION TOOLS ===
// add_annotation scenarios
{
id: 'add-simple-note',
description: 'Add a note annotation',
query:
'Add a note saying "Review this section" at coordinates (100, 200) with size 150x50 on page 1 of document doc-12345',
expectedTools: ['add_annotation'],
maxToolCalls: 1,
expectedParameters: {
add_annotation: {
document_fingerprint: { document_id: 'doc-12345' },
page_number: 0,
annotation_type: 'note',
content: 'Review this section',
coordinates: { left: 100, top: 200, width: 150, height: 50 },
},
},
},
{
id: 'add-highlight-with-author',
description: 'Add highlight annotation with author',
query:
'Highlight the text at position (50, 300) with size 200x20 on page 3 of document doc-12345, authored by "John Smith"',
expectedTools: ['add_annotation'],
maxToolCalls: 1,
expectedParameters: {
add_annotation: {
document_fingerprint: { document_id: 'doc-12345' },
page_number: 2,
annotation_type: 'highlight',
content: '',
coordinates: { left: 50, top: 300, width: 200, height: 20 },
author: 'John Smith',
},
},
},
{
id: 'add-link-annotation',
description: 'Add link annotation',
query:
'Add a link to "https://example.com" at coordinates (300, 400) with size 100x30 on page 2 of document doc-12345',
expectedTools: ['add_annotation'],
maxToolCalls: 1,
expectedParameters: {
add_annotation: {
document_fingerprint: { document_id: 'doc-12345' },
page_number: 1,
annotation_type: 'link',
content: 'https://example.com',
coordinates: { left: 300, top: 400, width: 100, height: 30 },
},
},
},
// read_annotations scenarios
{
id: 'read-all-annotations',
description: 'Read all annotations from document',
query: 'Show me all annotations in document doc-12345',
expectedTools: ['read_annotations'],
maxToolCalls: 1,
expectedParameters: {
read_annotations: { document_fingerprint: { document_id: 'doc-12345' } },
},
},
// delete_annotations scenarios
{
id: 'delete-specific-annotations',
description: 'Delete specific annotations',
query: 'Delete annotations with IDs "ann-1" and "ann-2" from document doc-12345',
expectedTools: ['delete_annotations'],
maxToolCalls: 1,
expectedParameters: {
delete_annotations: {
document_fingerprint: { document_id: 'doc-12345' },
annotation_ids: ['ann-1', 'ann-2'],
},
},
},
// === REDACTION TOOLS ===
// create_redaction scenarios
{
id: 'create-text-redaction',
description: 'Create redaction for specific text',
query:
'Create a redaction to hide all instances of "confidential information" in document doc-12345',
expectedTools: ['create_redaction'],
maxToolCalls: 1,
expectedParameters: {
create_redaction: {
document_fingerprint: { document_id: 'doc-12345' },
redaction_type: 'text',
text: 'confidential information',
},
},
},
{
id: 'create-regex-redaction',
description: 'Create regex-based redaction',
query:
'Create a redaction using regex pattern "\\d{3}-\\d{2}-\\d{4}" to hide SSNs in document doc-12345',
expectedTools: ['create_redaction'],
maxToolCalls: 1,
expectedParameters: {
create_redaction: {
document_fingerprint: { document_id: 'doc-12345' },
redaction_type: 'regex',
pattern: '\\d{3}-\\d{2}-\\d{4}',
},
},
},
{
id: 'create-preset-redaction-emails',
description: 'Create preset redaction for email addresses',
query: 'Create a redaction to hide all email addresses in document doc-12345',
expectedTools: ['create_redaction'],
maxToolCalls: 1,
expectedParameters: {
create_redaction: {
document_fingerprint: { document_id: 'doc-12345' },
redaction_type: 'preset',
preset: 'email-address',
},
},
},
{
id: 'create-preset-redaction-credit-cards',
description: 'Create preset redaction for credit card numbers',
query: 'Create a redaction to hide all credit card numbers in document doc-12345',
expectedTools: ['create_redaction'],
maxToolCalls: 1,
expectedParameters: {
create_redaction: {
document_fingerprint: { document_id: 'doc-12345' },
redaction_type: 'preset',
preset: 'credit-card-number',
},
},
},
// apply_redactions scenarios
{
id: 'apply-redactions',
description: 'Apply all redactions to document',
query: 'Apply all pending redactions to document doc-12345',
expectedTools: ['apply_redactions'],
maxToolCalls: 1,
expectedParameters: {
apply_redactions: { document_fingerprint: { document_id: 'doc-12345' } },
},
},
// === DOCUMENT EDITING TOOLS ===
// add_watermark scenarios
{
id: 'add-text-watermark-center',
description: 'Add centered text watermark',
query: 'Add a "DRAFT" watermark in the center of all pages in document doc-12345',
expectedTools: ['add_watermark'],
maxToolCalls: 1,
expectedParameters: {
add_watermark: {
document_fingerprint: { document_id: 'doc-12345' },
watermark_type: 'text',
content: 'DRAFT',
},
},
},
{
id: 'add-watermark-custom-opacity-rotation',
description: 'Add watermark with custom opacity and rotation',
query:
'Add a "CONFIDENTIAL" watermark at the bottom-right with 50% opacity, rotated 45 degrees, and font size 24 in document doc-12345',
expectedTools: ['add_watermark'],
maxToolCalls: 1,
expectedParameters: {
add_watermark: {
document_fingerprint: { document_id: 'doc-12345' },
watermark_type: 'text',
content: 'CONFIDENTIAL',
opacity: 0.5,
rotation: 45,
},
},
},
{
id: 'add-image-watermark',
description: 'Add image watermark',
query:
'Add an image watermark using "https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg" at the top-left with 80% opacity in document doc-12345',
expectedTools: ['add_watermark'],
maxToolCalls: 1,
expectedParameters: {
add_watermark: {
document_fingerprint: { document_id: 'doc-12345' },
watermark_type: 'image',
content: 'https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg',
opacity: 0.8,
},
},
},
// split_document scenarios
{
id: 'split-document-by-pages',
description: 'Split document by page ranges',
query: 'Split document doc-12345 at pages 3 and 5 to create separate documents',
expectedTools: ['split_document'],
maxToolCalls: 1,
expectedParameters: {
split_document: {
document_fingerprint: { document_id: 'doc-12345' },
split_points: [2, 4],
},
},
},
// duplicate_document scenarios
{
id: 'duplicate-document',
description: 'Create a copy of document',
query: 'Make a copy of document doc-12345',
expectedTools: ['duplicate_document'],
maxToolCalls: 1,
expectedParameters: {
duplicate_document: { document_fingerprint: { document_id: 'doc-12345' } },
},
},
// === HEALTH CHECK TOOL ===
{
id: 'health-check',
description: 'Check system health',
query: 'Check if the document engine is working properly',
expectedTools: ['health_check'],
maxToolCalls: 1,
},
// === MULTI-TOOL WORKFLOWS ===
{
id: 'search-then-extract',
description: 'Find document then extract text',
query:
'Find documents with "contract" in the title, then extract text from the first page of the first result',
expectedTools: ['list_documents', 'extract_text'],
maxToolCalls: 2,
expectedParameters: {
list_documents: { title: 'contract' },
extract_text: { page_range: { start: 0, end: 0 } },
},
},
{
id: 'info-then-extract-with-coordinates',
description: 'Get document info then extract text with coordinates',
query:
'First tell me about document doc-12345, then extract text from its first page including coordinate positions',
expectedTools: ['read_document_info', 'extract_text'],
maxToolCalls: 2,
expectedParameters: {
read_document_info: { document_fingerprint: { document_id: 'doc-12345' } },
extract_text: {
document_fingerprint: { document_id: 'doc-12345' },
page_range: { start: 0, end: 0 },
include_coordinates: true,
},
},
},
{
id: 'annotate-workflow-with-author',
description: 'Read document then add annotation with author',
query:
'Check the details of document doc-12345, then add a note saying "Reviewed" at position (100, 100) with size 200x50 on page 1, authored by "Jane Smith"',
expectedTools: ['read_document_info', 'add_annotation'],
maxToolCalls: 2,
expectedParameters: {
read_document_info: { document_fingerprint: { document_id: 'doc-12345' } },
add_annotation: {
document_fingerprint: { document_id: 'doc-12345' },
page_number: 0,
annotation_type: 'note',
content: 'Reviewed',
coordinates: { left: 100, top: 100, width: 200, height: 50 },
author: 'Jane Smith',
},
},
},
// Redaction workflows
{
id: 'redaction-workflow-preset',
description: 'Create and apply preset redaction',
query: 'Redact all email addresses in document doc-12345',
expectedTools: ['create_redaction', 'apply_redactions'],
maxToolCalls: 2,
expectedParameters: {
create_redaction: {
document_fingerprint: { document_id: 'doc-12345' },
redaction_type: 'preset',
preset: 'email-address',
},
apply_redactions: { document_fingerprint: { document_id: 'doc-12345' } },
},
},
{
id: 'complex-redaction-multiple-types',
description: 'Multiple redaction types',
query: 'Redact both email addresses and phone numbers in document doc-12345',
expectedTools: ['create_redaction', 'create_redaction', 'apply_redactions'],
maxToolCalls: 3,
allowExtraTools: false,
expectedParameters: {
create_redaction: [
{
document_fingerprint: { document_id: 'doc-12345' },
redaction_type: 'preset',
preset: 'email-address',
},
{
document_fingerprint: { document_id: 'doc-12345' },
redaction_type: 'preset',
preset: 'north-american-phone-number',
},
],
apply_redactions: { document_fingerprint: { document_id: 'doc-12345' } },
},
},
{
id: 'redaction-regex-workflow',
description: 'Create regex redaction and apply',
query:
'Create a redaction for Social Security Numbers (format XXX-XX-XXXX) in document doc-12345 and apply it',
expectedTools: ['create_redaction', 'apply_redactions'],
maxToolCalls: 2,
expectedParameters: {
create_redaction: {
document_fingerprint: { document_id: 'doc-12345' },
redaction_type: 'regex',
pattern: '\\d{3}-\\d{2}-\\d{4}',
},
apply_redactions: { document_fingerprint: { document_id: 'doc-12345' } },
},
},
// Form workflows
{
id: 'form-extract-fill-workflow',
description: 'Extract then fill form data',
query:
'First show me the form fields in document doc-form-123, then fill the "name" field with "John Smith"',
expectedTools: ['extract_form_data', 'fill_form_fields'],
maxToolCalls: 2,
expectedParameters: {
extract_form_data: { document_fingerprint: { document_id: 'doc-form-123' } },
fill_form_fields: {
document_fingerprint: { document_id: 'doc-form-123' },
field_values: [{ fieldName: 'name', value: 'John Smith' }],
},
},
},
{
id: 'form-extract-specific-fill-multiple',
description: 'Extract specific fields then fill multiple',
query:
'Check the current values of "name" and "email" fields in document doc-form-123, then fill "name" with "Alice Johnson" and "email" with "alice@example.com"',
expectedTools: ['extract_form_data', 'fill_form_fields'],
maxToolCalls: 2,
expectedParameters: {
extract_form_data: {
document_fingerprint: { document_id: 'doc-form-123' },
field_names: ['name', 'email'],
},
fill_form_fields: {
document_fingerprint: { document_id: 'doc-form-123' },
field_values: [
{ fieldName: 'name', value: 'Alice Johnson' },
{ fieldName: 'email', value: 'alice@example.com' },
],
},
},
},
// Document editing workflows
{
id: 'duplicate-then-watermark-workflow',
description: 'Duplicate then modify document',
query: 'Make a copy of document doc-12345, then add a "DRAFT" watermark to the copy',
expectedTools: ['duplicate_document', 'add_watermark'],
maxToolCalls: 2,
expectedParameters: {
duplicate_document: { document_fingerprint: { document_id: 'doc-12345' } },
add_watermark: {
watermark_type: 'text',
content: 'DRAFT',
},
},
},
{
id: 'search-extract-annotate-workflow',
description: 'Search, extract, then annotate',
query:
'Search for "important" in document doc-12345, extract text from pages where it appears, then add a highlight annotation at (200, 300) with size 150x25 on page 1',
expectedTools: ['search', 'extract_text', 'add_annotation'],
maxToolCalls: 3,
expectedParameters: {
search: {
document_fingerprint: { document_id: 'doc-12345' },
query: 'important',
},
add_annotation: {
document_fingerprint: { document_id: 'doc-12345' },
page_number: 0,
annotation_type: 'highlight',
content: '',
coordinates: { left: 200, top: 300, width: 150, height: 25 },
},
},
},
// === EFFICIENCY TESTS (should NOT require multiple tools) ===
{
id: 'efficiency-single-extract',
description: 'Extract text efficiently',
query: 'Get the text content from document doc-12345',
expectedTools: ['extract_text'],
maxToolCalls: 1, // Should NOT call read_document_info first
expectedParameters: {
extract_text: { document_fingerprint: { document_id: 'doc-12345' } },
},
},
{
id: 'efficiency-direct-annotation',
description: 'Add annotation directly',
query:
'Add a highlight annotation at coordinates (100, 200) with size 150x30 on page 1 of document doc-12345',
expectedTools: ['add_annotation'],
maxToolCalls: 1, // Should NOT call read_document_info first
expectedParameters: {
add_annotation: {
document_fingerprint: { document_id: 'doc-12345' },
page_number: 0,
annotation_type: 'highlight',
content: '',
coordinates: { left: 100, top: 200, width: 150, height: 30 },
},
},
},
{
id: 'efficiency-direct-search',
description: 'Search directly without document info',
query: 'Find all instances of "contract" in document doc-12345',
expectedTools: ['search'],
maxToolCalls: 1, // Should NOT call read_document_info first
expectedParameters: {
search: {
document_fingerprint: { document_id: 'doc-12345' },
query: 'contract',
},
},
},
// === ORDER SENSITIVITY TESTS ===
{
id: 'order-create-before-apply',
description: 'Create redaction before applying',
query: 'Apply email redactions to document doc-12345',
expectedTools: ['create_redaction', 'apply_redactions'],
maxToolCalls: 2,
allowExtraTools: false, // Order matters - must create before apply
expectedParameters: {
create_redaction: {
document_fingerprint: { document_id: 'doc-12345' },
redaction_type: 'preset',
preset: 'email-address',
},
apply_redactions: { document_fingerprint: { document_id: 'doc-12345' } },
},
},
{
id: 'order-search-before-extract',
description: 'Search before extracting',
query: 'Find the contract document and extract its summary section',
expectedTools: ['list_documents', 'extract_text'],
maxToolCalls: 2,
allowExtraTools: false, // Must search first to know which document
expectedParameters: {
list_documents: { title: 'contract' },
},
},
{
id: 'order-extract-form-before-fill',
description: 'Extract form data before filling',
query: 'Update the form in document doc-form-123 by changing the name field to "Bob Wilson"',
expectedTools: ['extract_form_data', 'fill_form_fields'],
maxToolCalls: 2,
expectedParameters: {
extract_form_data: { document_fingerprint: { document_id: 'doc-form-123' } },
fill_form_fields: {
document_fingerprint: { document_id: 'doc-form-123' },
field_values: [{ fieldName: 'name', value: 'Bob Wilson' }],
},
},
},
// === PARAMETER EDGE CASES ===
{
id: 'edge-case-zero-based-pages',
description: 'Test zero-based page indexing understanding',
query: 'Extract text from the very first page of document doc-12345',
expectedTools: ['extract_text'],
maxToolCalls: 1,
expectedParameters: {
extract_text: {
document_fingerprint: { document_id: 'doc-12345' },
page_range: { start: 0, end: 0 },
},
},
},
{
id: 'edge-case-page-range-conversion',
description: 'Test human-friendly to zero-based page conversion',
query: 'Search for "summary" in pages 2 through 5 of document doc-12345',
expectedTools: ['search'],
maxToolCalls: 1,
expectedParameters: {
search: {
document_fingerprint: { document_id: 'doc-12345' },
query: 'summary',
start_page: 1,
end_page: 4,
},
},
},
{
id: 'edge-case-boolean-parameters',
description: 'Test boolean parameter extraction',
query:
'Extract text from document doc-12345 with OCR enabled but without coordinate information',
expectedTools: ['extract_text'],
maxToolCalls: 1,
expectedParameters: {
extract_text: {
document_fingerprint: { document_id: 'doc-12345' },
ocr_enabled: true,
include_coordinates: false,
},
},
},
{
id: 'edge-case-numeric-parameters',
description: 'Test numeric parameter extraction',
query:
'Add a "CONFIDENTIAL" watermark with 25% opacity, rotated 90 degrees counterclockwise, using font size 18 in document doc-12345',
expectedTools: ['add_watermark'],
maxToolCalls: 1,
expectedParameters: {
add_watermark: {
document_fingerprint: { document_id: 'doc-12345' },
watermark_type: 'text',
content: 'CONFIDENTIAL',
opacity: 0.25,
rotation: 90,
},
},
},
{
id: 'edge-case-array-parameters',
description: 'Test array parameter extraction',
query:
'Get only the "firstName", "lastName", and "dateOfBirth" fields from document doc-form-123',
expectedTools: ['extract_form_data'],
maxToolCalls: 1,
expectedParameters: {
extract_form_data: {
document_fingerprint: { document_id: 'doc-form-123' },
field_names: ['firstName', 'lastName', 'dateOfBirth'],
},
},
},
// === EXTRACT KEY-VALUE PAIRS TOOL SCENARIOS ===
{
id: 'extract-kvp-full-document',
description: 'Extract key-value pairs from entire document',
query: 'Extract all key-value pairs from document doc-form-123',
expectedTools: ['extract_key_value_pairs'],
maxToolCalls: 1,
expectedParameters: {
extract_key_value_pairs: { document_fingerprint: { document_id: 'doc-form-123' } },
},
},
{
id: 'extract-kvp-page-range',
description: 'Extract key-value pairs from specific pages',
query: 'Extract key-value pairs from page 1 of document doc-form-123',
expectedTools: ['extract_key_value_pairs'],
maxToolCalls: 1,
expectedParameters: {
extract_key_value_pairs: {
document_fingerprint: { document_id: 'doc-form-123' },
page_range: { start: 0, end: 0 },
},
},
},
// === PAGE MANIPULATION TOOL SCENARIOS ===
// add_new_page scenarios
{
id: 'add-page-default',
description: 'Add page with default settings',
query: 'Add a new blank page to document doc-12345',
expectedTools: ['add_new_page'],
maxToolCalls: 1,
expectedParameters: {
add_new_page: { document_fingerprint: { document_id: 'doc-12345' } },
},
},