Skip to content

Stubbing out new Responses API #773

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

Draft
wants to merge 58 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
2e286c3
refactor GenerateRespose
Apr 28, 2025
0be9fe2
Clean up imports
Apr 28, 2025
2556bc2
consolidate generate user prompt to the legacy file
Apr 28, 2025
feee66a
update test config imports
Apr 28, 2025
f6fe862
Fix broken tests
Apr 28, 2025
0fc58bd
get started
Apr 28, 2025
ea40c6d
nominally working generate res w/ search
Apr 28, 2025
c3e69e3
small refactors
Apr 29, 2025
0345453
aint pretty but fully functional
Apr 29, 2025
a4144db
hacky if more functional
Apr 29, 2025
04076d2
more hack
May 2, 2025
8372bd3
tools
May 2, 2025
24d1cf7
functional if not pretty
May 9, 2025
40fa9d1
Add processing
May 12, 2025
31bd0a8
working tool calling
May 22, 2025
653aa59
making progress
May 23, 2025
9d68d50
keepin on
May 23, 2025
57e65a2
Clean config
May 23, 2025
aefa9ca
working e2e
May 27, 2025
c33f64e
update model version
May 27, 2025
c87dc74
(EAI-988): Refactor `GenerateResponse` for tool call support (#687)
mongodben May 27, 2025
c446756
Merge remote-tracking branch 'upstream/retrieval_tool_call' into EAI-990
May 27, 2025
728416f
Remove no longer used stuff
May 27, 2025
479ccb8
decouple search results for references and whats shown to model
May 27, 2025
cc8dd45
fix scripts build errs
May 27, 2025
e768dd6
fix broken tests
May 27, 2025
2bce005
update default ref links
May 27, 2025
b8f3754
fix broken tests
May 27, 2025
d19fdb1
input guardrail refactor
May 28, 2025
09071bc
guardrail works well
May 28, 2025
3fa56f7
simpler validity metric
May 28, 2025
4b2f6c0
add guardrail to server
May 28, 2025
8c1144e
add next step todo
May 28, 2025
3a1c8e8
llm refusal msg
May 29, 2025
c20e38d
remove TODO comment
May 29, 2025
5c53db3
evals on new architecture
May 29, 2025
3e7b629
Get urls in a way that supports verified answers
May 29, 2025
fd2f11d
dont eval on retrieved elems if no context
May 29, 2025
3ac6905
Cleaner handling
May 30, 2025
fb5aedb
update trace handling
May 30, 2025
2c692b8
update trace handling
May 30, 2025
50d3f44
(EAI-990): Refactor search as a tool (#705)
mongodben Jun 4, 2025
83ce032
(EAI-992): Remove `ChatLlm` (#751)
mongodben Jun 4, 2025
8eb82bf
(EAI-993): deprecate framework (#752)
mongodben Jun 5, 2025
4d53e02
(EAI-1071): Fix broken Atlas OpenAPI ingest (#765)
mongodben Jun 6, 2025
723429e
(EAI-995): add guardrail (#755)
mongodben Jun 6, 2025
7ea0c5b
Merge remote-tracking branch 'upstream/retrieval_tool_call' into EAI-991
Jun 6, 2025
2a47887
undo git funk
Jun 6, 2025
320e46f
Merge remote-tracking branch 'upstream/EAI-1050' into EAI-991
Jun 10, 2025
4776dbe
Merge remote-tracking branch 'upstream/main' into retrieval_tool_call
Jun 10, 2025
03940c5
fix type in text
Jun 10, 2025
3787913
Merge branch 'retrieval_tool_call' into EAI-991
Jun 10, 2025
30dd0fe
handle undefined case
Jun 10, 2025
c482592
Fix tracing test
Jun 10, 2025
74dd273
responses refactor
Jun 10, 2025
ee1f169
updates to support throughout package
Jun 11, 2025
cb2f495
Merge remote-tracking branch 'upstream/main' into demo_responses_api
Jun 16, 2025
ba9f484
update contributing
ASteinheiser Jun 17, 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
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The monorepo has the following main projects, each of which correspond to a Java
These packages power our RAG applications.

- `mongodb-rag-core`: A set of common resources (modules, functions, types, etc.) shared across projects.
- You need to recompile `mongodb-rag-core` by running `npm run build` every time you update it for the changes to be accessible in the other projects that dependend on it.
- You need to recompile `mongodb-rag-core` by running `npm run build` every time you update it for the changes to be accessible in the other projects that depend on it.
- `mongodb-rag-ingest`: CLI application that takes data from data sources and converts it to `embedded_content` used by Atlas Vector Search.

### MongoDB Chatbot Framework
Expand All @@ -40,7 +40,7 @@ general, we publish these as reusable packages on npm.
These packages are our production chatbot. They build on top of the Chatbot
Framework packages and add MongoDB-specific implementations.

- `chatbot-eval-mongodb-public`: Test suites, evaluators, and reports for the MongoDB AI Chatbot
- `chatbot-eval-mongodb-public`: Test suites, evaluators, and reports for the MongoDB AI Chatbot.
- `chatbot-server-mongodb-public`: Chatbot server implementation with our MongoDB-specific configuration.
- `ingest-mongodb-public`: RAG ingest service configured to ingest MongoDB Docs, DevCenter, MDBU, MongoDB Press, etc.

Expand Down Expand Up @@ -132,7 +132,7 @@ npm run dev

## Infrastructure

The projects uses Drone for its CI/CD pipeline. All drone config is located in `.drone.yml`.
The projects use Drone for their CI/CD pipeline. All drone configs are located in `.drone.yml`.

Applications are deployed on Kubernetes using the Kanopy developer platform.
Kubernetes/Kanopy configuration are found in the `<deployed project>/environments`
Expand Down
157 changes: 77 additions & 80 deletions package-lock.json

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

8 changes: 7 additions & 1 deletion packages/chatbot-server-mongodb-public/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
defaultCreateConversationCustomData,
defaultAddMessageToConversationCustomData,
makeVerifiedAnswerGenerateResponse,
addMessageToConversationVerifiedAnswerStream,
} from "mongodb-chatbot-server";
import cookieParser from "cookie-parser";
import { blockGetRequests } from "./middleware/blockGetRequests";
Expand Down Expand Up @@ -53,7 +54,10 @@ import {
import { useSegmentIds } from "./middleware/useSegmentIds";
import { makeSearchTool } from "./tools/search";
import { makeMongoDbInputGuardrail } from "./processors/mongoDbInputGuardrail";
import { makeGenerateResponseWithSearchTool } from "./processors/generateResponseWithSearchTool";
import {
addMessageToConversationStream,
makeGenerateResponseWithSearchTool,
} from "./processors/generateResponseWithSearchTool";
import { makeBraintrustLogger } from "mongodb-rag-core/braintrust";
import { makeMongoDbScrubbedMessageStore } from "./tracing/scrubbedMessages/MongoDbScrubbedMessageStore";
import { MessageAnalysis } from "./tracing/scrubbedMessages/analyzeMessage";
Expand Down Expand Up @@ -218,6 +222,7 @@ export const generateResponse = wrapTraced(
references: verifiedAnswer.references.map(addReferenceSourceType),
};
},
stream: addMessageToConversationVerifiedAnswerStream,
onNoVerifiedAnswerFound: wrapTraced(
makeGenerateResponseWithSearchTool({
languageModel,
Expand All @@ -240,6 +245,7 @@ export const generateResponse = wrapTraced(
searchTool: makeSearchTool(findContent),
toolChoice: "auto",
maxSteps: 5,
stream: addMessageToConversationStream,
}),
{ name: "GenerateResponseWithSearchTool" }
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ describe("generateResponseWithSearchTool", () => {
disconnect: mockDisconnect,
streamData: mockStreamData,
stream: mockStream,
streamResponsesApiPart: mockStream,
} as DataStreamer;

return dataStreamer;
Expand Down
Loading