Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
1295d51
add feature flag
mabaasit Nov 25, 2025
7a44de4
migrate prompts to compass
mabaasit Nov 25, 2025
2e2defe
Merge branch 'main' into COMPASS-10082-add-mms-prompts-and-feature-flag
mabaasit Nov 25, 2025
d524682
co-pilot feedback
mabaasit Nov 25, 2025
f9212fb
Merge branch 'COMPASS-10082-add-mms-prompts-and-feature-flag' of http…
mabaasit Nov 25, 2025
c96161b
clean up
mabaasit Dec 1, 2025
f499026
Merge branch 'main' into COMPASS-10082-add-mms-prompts-and-feature-flag
mabaasit Dec 1, 2025
f4d05a7
use edu api for gen ai
mabaasit Dec 1, 2025
1763531
clean up a bit
mabaasit Dec 1, 2025
d5e2c84
fix url for test and ensure aggregations have content
mabaasit Dec 2, 2025
0781580
tests
mabaasit Dec 3, 2025
058e950
fix error handling
mabaasit Dec 3, 2025
7d54d4d
clean up transport
mabaasit Dec 3, 2025
0aa7ff5
Merge branch 'main' of https://github.com/mongodb-js/compass into COM…
mabaasit Dec 3, 2025
309335a
changes in field name
mabaasit Dec 3, 2025
feacddc
use query parser
mabaasit Dec 3, 2025
c321983
fix check
mabaasit Dec 3, 2025
f5a34df
fix test
mabaasit Dec 3, 2025
91b17d5
clean up
mabaasit Dec 3, 2025
ea4dfdf
copilot feedback
mabaasit Dec 3, 2025
f8a4c43
fix log id
mabaasit Dec 3, 2025
8190219
fix cors issue on e2e tests
mabaasit Dec 4, 2025
c444cb9
more tests
mabaasit Dec 4, 2025
6eec8db
add type
mabaasit Dec 4, 2025
25c8089
wip
mabaasit Dec 8, 2025
9b4c9b7
fix alltext
mabaasit Dec 8, 2025
5e6d537
make expected output xml string
mabaasit Dec 9, 2025
d1b0b51
add fixtures and run gen ai eval tests
mabaasit Dec 10, 2025
1b7343f
ts fixes
mabaasit Dec 10, 2025
a1b38c5
reformat
mabaasit Dec 10, 2025
79e9910
clean up scorer
mabaasit Dec 10, 2025
821917d
Merge branch 'main' of https://github.com/mongodb-js/compass into eva…
mabaasit Dec 11, 2025
3bc7295
bootstrap
mabaasit Dec 11, 2025
eb49493
remove extra files
mabaasit Dec 11, 2025
fa1cf6f
Merge branch 'main' of https://github.com/mongodb-js/compass into eva…
mabaasit Dec 15, 2025
edc5e73
bootstrap
mabaasit Dec 15, 2025
718e8b7
fix prompts and data
mabaasit Dec 15, 2025
5244598
Merge branch 'main' of https://github.com/mongodb-js/compass into eva…
mabaasit Dec 15, 2025
534b0d8
copilot review
mabaasit Dec 15, 2025
d0568ff
reduce num of docs
mabaasit Dec 16, 2025
40ad7c9
reduce fixtures
mabaasit Dec 16, 2025
48b38ce
Merge branch 'main' of https://github.com/mongodb-js/compass into eva…
mabaasit Dec 16, 2025
6153f52
check fix
mabaasit Dec 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion packages/compass-generative-ai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"test-watch": "npm run test -- --watch",
"test-ci": "npm run test-cov",
"test-ci-electron": "npm run test-electron",
"reformat": "npm run eslint . -- --fix && npm run prettier -- --write ."
"reformat": "npm run eslint . -- --fix && npm run prettier -- --write .",
"eval": "braintrust eval tests/evals"
},
"dependencies": {
"@mongodb-js/atlas-service": "^0.73.0",
Expand Down Expand Up @@ -84,10 +85,13 @@
"@types/mocha": "^9.0.0",
"@types/react": "^17.0.5",
"@types/sinon-chai": "^3.2.5",
"autoevals": "^0.0.130",
"braintrust": "^0.2.4",
"chai": "^4.3.6",
"depcheck": "^1.4.1",
"electron-mocha": "^12.2.0",
"mocha": "^10.2.0",
"mongodb-ns": "^3.1.0",
"nyc": "^15.1.0",
"p-queue": "^7.4.1",
"sinon": "^9.2.3",
Expand Down
42 changes: 42 additions & 0 deletions packages/compass-generative-ai/tests/evals/chatbot-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { streamText } from 'ai';
import { createOpenAI } from '@ai-sdk/openai';
import type {
ConversationEvalCaseInput,
ConversationTaskOutput,
} from './types';

export async function makeChatbotCall(
input: ConversationEvalCaseInput
): Promise<ConversationTaskOutput> {
const openai = createOpenAI({
baseURL:
process.env.COMPASS_ASSISTANT_BASE_URL_OVERRIDE ??
'https://eval.knowledge-dev.mongodb.com/api/v1',
apiKey: '',
headers: {
'X-Request-Origin': 'compass-gen-ai-braintrust',
'User-Agent': 'mongodb-compass/x.x.x',
},
});
const result = streamText({
model: openai.responses('mongodb-slim-latest'),
temperature: undefined,
prompt: input.messages,
providerOptions: {
openai: {
instructions: input.instructions.content,
store: false,
},
},
});

const chunks: string[] = [];
for await (const chunk of result.toUIMessageStream()) {
if (chunk.type === 'text-delta') {
chunks.push(chunk.delta);
}
}
return {
messages: [{ content: chunks.join('') }],
};
}
Loading
Loading