Update googleGemini.js
Browse files- googleGemini.js +3 -2
googleGemini.js
CHANGED
@@ -6,12 +6,13 @@ const genAI = new GoogleGenerativeAI(config.GoogleAPIKey);
|
|
6 |
|
7 |
/**
|
8 |
* @param {string} prompt - The input string for the model.
|
|
|
9 |
* @returns {Promise<string>} The generated response text.
|
10 |
*/
|
11 |
-
async function GeminiResponse(prompt) {
|
12 |
try {
|
13 |
const model = genAI.getGenerativeModel({
|
14 |
-
model:
|
15 |
});
|
16 |
const result = await model.generateContent(prompt);
|
17 |
const text = result.response.candidates[0]?.content;
|
|
|
6 |
|
7 |
/**
|
8 |
* @param {string} prompt - The input string for the model.
|
9 |
+
* @param {string} setModel - you can change the model
|
10 |
* @returns {Promise<string>} The generated response text.
|
11 |
*/
|
12 |
+
async function GeminiResponse(prompt, setModel) {
|
13 |
try {
|
14 |
const model = genAI.getGenerativeModel({
|
15 |
+
model: setModel,
|
16 |
});
|
17 |
const result = await model.generateContent(prompt);
|
18 |
const text = result.response.candidates[0]?.content;
|