File tree Expand file tree Collapse file tree 2 files changed +43
-7
lines changed Expand file tree Collapse file tree 2 files changed +43
-7
lines changed Original file line number Diff line number Diff line change @@ -18,15 +18,21 @@ export class ExportTool extends MongoDBToolBase {
1818 . array (
1919 z . discriminatedUnion ( "name" , [
2020 z . object ( {
21- name : z . literal ( "find" ) ,
22- arguments : z . object ( {
23- ...FindArgs ,
24- limit : FindArgs . limit . removeDefault ( ) ,
25- } ) ,
21+ name : z
22+ . literal ( "find" )
23+ . describe ( "The literal name 'find' to represent a find cursor as target." ) ,
24+ arguments : z
25+ . object ( {
26+ ...FindArgs ,
27+ limit : FindArgs . limit . removeDefault ( ) ,
28+ } )
29+ . describe ( "The arguments for 'find' operation." ) ,
2630 } ) ,
2731 z . object ( {
28- name : z . literal ( "aggregate" ) ,
29- arguments : z . object ( AggregateArgs ) ,
32+ name : z
33+ . literal ( "aggregate" )
34+ . describe ( "The literal name 'aggregate' to represent an aggregation cursor as target." ) ,
35+ arguments : z . object ( AggregateArgs ) . describe ( "The arguments for 'aggregate' operation." ) ,
3036 } ) ,
3137 ] )
3238 )
Original file line number Diff line number Diff line change @@ -95,4 +95,34 @@ describeAccuracyTests([
9595 } ,
9696 ] ,
9797 } ,
98+ {
99+ prompt : "Export an aggregation that groups all movie titles by the field release_year from mflix.movies" ,
100+ expectedToolCalls : [
101+ {
102+ toolName : "export" ,
103+ parameters : {
104+ database : "mflix" ,
105+ collection : "movies" ,
106+ exportTitle : Matcher . string ( ) ,
107+ exportTarget : [
108+ {
109+ name : "aggregate" ,
110+ arguments : {
111+ pipeline : [
112+ {
113+ $group : {
114+ _id : "$release_year" ,
115+ titles : {
116+ $push : "$title" ,
117+ } ,
118+ } ,
119+ } ,
120+ ] ,
121+ } ,
122+ } ,
123+ ] ,
124+ } ,
125+ } ,
126+ ] ,
127+ } ,
98128] ) ;
You can’t perform that action at this time.
0 commit comments