Skip to content

Commit

Permalink
fix: use the correct embedding model for verified answers (#561)
Browse files Browse the repository at this point in the history
correct VA embedder
  • Loading branch information
mongodben authored Nov 26, 2024
1 parent b09d162 commit 98c56d3
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/chatbot-server-mongodb-public/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,21 @@ export const verifiedAnswerStore = makeMongoDbVerifiedAnswerStore({
collectionName: "verified_answers",
});

const verifiedAnswersEmbedder = makeOpenAiEmbedder({
openAiClient,
deployment: verifiedAnswerConfig.embeddingModel,
backoffOptions: {
numOfAttempts: 3,
maxDelay: 5000,
},
});
verifiedAnswersEmbedder.embed = wrapTraced(verifiedAnswersEmbedder.embed, {
name: "embedVerifiedAnswers",
});

export const findVerifiedAnswer = wrapTraced(
makeDefaultFindVerifiedAnswer({
embedder,
embedder: verifiedAnswersEmbedder,
store: verifiedAnswerStore,
findNearestNeighborsOptions:
verifiedAnswerConfig.findNearestNeighborsOptions,
Expand Down

0 comments on commit 98c56d3

Please sign in to comment.