Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add braintrust to mongodb-rag-core #578

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1,081 changes: 692 additions & 389 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion packages/benchmarks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"dependencies": {
"@aws-sdk/client-bedrock-runtime": "^3.705.0",
"@supercharge/promise-pool": "^3.2.0",
"braintrust": "^0.0.175",
"dotenv": "^16",
"mongodb-chatbot-server": "*",
"mongodb-rag-core": "*",
Expand Down
7 changes: 6 additions & 1 deletion packages/benchmarks/src/discovery/DiscoveryEval.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { strict as assert } from "assert";
import { Eval, EvalCase, EvalScorer, EvalTask } from "braintrust";
import {
Eval,
EvalCase,
EvalScorer,
EvalTask,
} from "mongodb-rag-core/braintrust";
import { OpenAI } from "mongodb-rag-core/openai";
import fs from "fs";
import { getConversationsEvalCasesFromYaml } from "mongodb-rag-core/eval";
Expand Down
2 changes: 1 addition & 1 deletion packages/benchmarks/src/makeOpenAiClientFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from "@aws-sdk/client-bedrock-runtime";
import { ModelConfig } from "./models";
import { strict as assert } from "assert";
import { wrapOpenAI, wrapTraced } from "braintrust";
import { wrapOpenAI, wrapTraced } from "mongodb-rag-core/braintrust";
interface BaseModelProviderConfig {
apiKey: string;
endpoint: string;
Expand Down
7 changes: 6 additions & 1 deletion packages/benchmarks/src/quizQuestions/QuizQuestionEval.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { Eval, EvalCase, EvalScorer, EvalTask } from "braintrust";
import {
Eval,
EvalCase,
EvalScorer,
EvalTask,
} from "mongodb-rag-core/braintrust";
import { OpenAI } from "mongodb-rag-core/openai";
import { QuizQuestionData } from "./QuizQuestionData";
import { strict as assert } from "assert";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { initDataset } from "braintrust";
import { initDataset } from "mongodb-rag-core/braintrust";
import { QuizQuestionDataSchema } from "./QuizQuestionData";
import { z } from "zod";
import { QuizQuestionEvalCase } from "./QuizQuestionEval";
Expand Down
1 change: 0 additions & 1 deletion packages/chatbot-server-mongodb-public/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"@typescript-eslint/parser": "^5.58.0",
"autoevals": "^0.0.92",
"babel-jest": "^29.5.0",
"braintrust": "^0.0.167",
"eslint": "^8.38.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-jest": "^27.2.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/chatbot-server-mongodb-public/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { systemPrompt } from "./systemPrompt";
import { addReferenceSourceType } from "./processors/makeMongoDbReferences";
import path from "path";
import express from "express";
import { wrapOpenAI, wrapTraced } from "braintrust";
import { wrapOpenAI, wrapTraced } from "mongodb-rag-core/braintrust";
import { AzureOpenAI } from "mongodb-rag-core/openai";
import { MongoClient } from "mongodb-rag-core/mongodb";
export const {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { Eval, EvalCase, traced, EvalScorer } from "braintrust";
import {
Eval,
EvalCase,
traced,
EvalScorer,
} from "mongodb-rag-core/braintrust";
import { getConversationsEvalCasesFromYaml } from "mongodb-rag-core/eval";
import { MongoDbTag } from "./mongoDbMetadata";
import { config, conversations } from "./config";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import "dotenv/config";
import { Eval, EvalCase, EvalScorer, EvalTask } from "braintrust";
import {
Eval,
EvalCase,
EvalScorer,
EvalTask,
} from "mongodb-rag-core/braintrust";
import fs from "fs";
import path from "path";
import { strict as assert } from "assert";
Expand Down
2 changes: 2 additions & 0 deletions packages/mongodb-rag-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"./langchain": "./build/langchain.js",
"./mongodb": "./build/mongodb.js",
"./openai": "./build/openai.js",
"./braintrust": "./build/braintrust.js",
"./dataSources": "./build/dataSources/index.js",
"./eval": "./build/eval/index.js"
},
Expand Down Expand Up @@ -79,6 +80,7 @@
"@supercharge/promise-pool": "^3.2.0",
"acquit": "^1.3.0",
"acquit-require": "^0.1.1",
"braintrust": "^0.0.176",
"common-tags": "^1",
"deep-equal": "^2.2.3",
"dotenv": "^16.3.1",
Expand Down
1 change: 1 addition & 0 deletions packages/mongodb-rag-core/src/braintrust.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "braintrust";