Skip to content

Commit

Permalink
patch gemini embedding key preference
Browse files Browse the repository at this point in the history
resolves #2972
  • Loading branch information
timothycarambat committed Jan 14, 2025
1 parent 21af810 commit 4d5d8d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/utils/EmbeddingEngines/gemini/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
class GeminiEmbedder {
constructor() {
if (!process.env.GEMINI_API_KEY)
if (!process.env.GEMINI_EMBEDDING_API_KEY)
throw new Error("No Gemini API key was set.");
const { GoogleGenerativeAI } = require("@google/generative-ai");
const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY);
const genAI = new GoogleGenerativeAI(process.env.GEMINI_EMBEDDING_API_KEY);
this.model = process.env.EMBEDDING_MODEL_PREF || "text-embedding-004";
this.gemini = genAI.getGenerativeModel({ model: this.model });

Expand Down

0 comments on commit 4d5d8d4

Please sign in to comment.