-
Notifications
You must be signed in to change notification settings - Fork 74
(EAI-990): Refactor search as a tool #705
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
Conversation
packages/mongodb-chatbot-server/src/processors/generateResponseWithSearchTool.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - lots going on in this one so generally trusting you that it works as expected. Proof is in the pudding!
const result = makeMongoDbReferences( | ||
chunks.map((c) => ({ | ||
...c, | ||
title: c.metadata?.pageTitle, | ||
})) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to modify the chunks here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
umm we probably dont. esp based on what the change is doing. will poke at and either 1) report back on why we do, or 2) revert
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update: reverting. no change in behavior
'If the user query is already a "good" search query, do not modify it.', | ||
'For one word queries like "or", "and", "exists", if the query corresponds to a MongoDB operation, transform it into a fully formed question. Ex: If the user query is "or", transform it into "what is the $or operator in MongoDB?".', | ||
"You should also transform the user query into a fully formed question, if relevant.", | ||
`Only generate ONE ${SEARCH_TOOL_NAME} tool call per user message unless there are clearly multiple distinct queries needed to answer the user query.`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume we handle the multiple tool call case in regards to reference links?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, it all appends to an array of references, which is streamed after the text generation
@@ -12,6 +12,7 @@ export function extractTracingData( | |||
messages: Message[], | |||
assistantMessageId: ObjectId | |||
) { | |||
// FIXME: this is throwing after the generation is complete. don't forget to fix before merge of EAI-990 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this and other TODO in this file fixed in another PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in other PR! #759
dataStreamer, | ||
}); | ||
|
||
// TODO: verify dataStreamer was called |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need todo still or covered in another PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm not sure, will add here just in case. easy fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was added in later PR but added here as well, just in case
packages/mongodb-chatbot-server/src/processors/makeDefaultReferenceLinks.ts
Outdated
Show resolved
Hide resolved
packages/mongodb-chatbot-server/src/processors/makeDefaultReferenceLinks.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Nick Larew <[email protected]>
Jira: https://jira.mongodb.org/browse/EAI-990
Changes
generateResponseWithSearchTool()
to be used with arbitrary search tool inmongodb-chatbot-server
chatbot-server-mongodb-public
Notes