Skip to content

Commit 8477a80

Browse files
modify prompt for list-collections prompt and log tools provided
1 parent 01e4d47 commit 8477a80

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tests/accuracy/collection-indexes.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ describeAccuracyTests("collection-indexes", getAvailableModels(), [
3737
callsCollectionIndexes("How many indexes do I have in 'db1.coll1' namespace?"),
3838
callsCollectionIndexes("List all the indexes in coll1 collection in db1 database"),
3939
callsCollectionIndexes(
40-
`Will this query: ${JSON.stringify({ year: 1994 })} on the namespace 'db1.coll1' be a collection scan?`
40+
`Is the following query: ${JSON.stringify({ year: 1994 })} on the namespace 'db1.coll1' indexed?`
4141
),
4242
]);

tests/accuracy/sdk/describe-accuracy-tests.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ export function describeAccuracyTests(
4545

4646
eachTest("$prompt", async function (testConfig) {
4747
testTools.mockTools(testConfig.mockedTools);
48+
const toolsForModel = testTools.vercelAiTools();
4849
const promptForModel = testConfig.injectConnectedAssumption
4950
? [testConfig.prompt, "(Assume that you are already connected to a MongoDB cluster!)"].join(" ")
5051
: testConfig.prompt;
51-
const conversation = await agent.prompt(promptForModel, model, testTools.vercelAiTools());
52+
const conversation = await agent.prompt(promptForModel, model, toolsForModel);
5253
const toolCalls = testTools.getToolCalls();
5354
const toolCallingAccuracy = toolCallingAccuracyScorer(testConfig.expectedToolCalls, toolCalls);
5455
const parameterMatchingAccuracy = parameterMatchingAccuracyScorer(testConfig.expectedToolCalls, toolCalls);
@@ -73,6 +74,7 @@ export function describeAccuracyTests(
7374
expect(parameterMatchingAccuracy).toBeGreaterThanOrEqual(0.5);
7475
} catch (error) {
7576
console.warn(`Accuracy test failed for ${model.modelName} - ${suiteName} - ${testConfig.prompt}`);
77+
console.debug(`Provided tools`, JSON.stringify(toolsForModel, null, 2));
7678
console.debug(`Conversation`, JSON.stringify(conversation, null, 2));
7779
console.debug(`Tool calls`, JSON.stringify(toolCalls, null, 2));
7880
console.debug(`Tool calling accuracy`, toolCallingAccuracy);

0 commit comments

Comments
 (0)