Skip to content

Commit aec630b

Browse files
chore: add accuracy test for export tool
1 parent 9520c5b commit aec630b

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

tests/accuracy/export.test.ts

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import { describeAccuracyTests } from "./sdk/describeAccuracyTests.js";
2+
import { Matcher } from "./sdk/matcher.js";
3+
4+
describeAccuracyTests([
5+
{
6+
prompt: "Export all the movies in 'mflix.movies' namespace.",
7+
expectedToolCalls: [
8+
{
9+
toolName: "export",
10+
parameters: {
11+
database: "mflix",
12+
collection: "movies",
13+
filter: Matcher.emptyObjectOrUndefined,
14+
limit: Matcher.undefined,
15+
},
16+
},
17+
],
18+
},
19+
{
20+
prompt: "Export all the movies in 'mflix.movies' namespace with runtime less than 100.",
21+
expectedToolCalls: [
22+
{
23+
toolName: "export",
24+
parameters: {
25+
database: "mflix",
26+
collection: "movies",
27+
filter: {
28+
runtime: { $lt: 100 },
29+
},
30+
},
31+
},
32+
],
33+
},
34+
{
35+
prompt: "Export all the movie titles available in 'mflix.movies' namespace",
36+
expectedToolCalls: [
37+
{
38+
toolName: "export",
39+
parameters: {
40+
database: "mflix",
41+
collection: "movies",
42+
projection: {
43+
title: 1,
44+
_id: Matcher.anyOf(
45+
Matcher.undefined,
46+
Matcher.number((value) => value === 0)
47+
),
48+
},
49+
filter: Matcher.emptyObjectOrUndefined,
50+
},
51+
},
52+
],
53+
},
54+
{
55+
prompt: "From the mflix.movies namespace, export the first 2 movies of Horror genre sorted ascending by their runtime",
56+
expectedToolCalls: [
57+
{
58+
toolName: "export",
59+
parameters: {
60+
database: "mflix",
61+
collection: "movies",
62+
filter: { genres: "Horror" },
63+
sort: { runtime: 1 },
64+
limit: 2,
65+
},
66+
},
67+
],
68+
},
69+
]);

0 commit comments

Comments
 (0)