randydev commited on
Commit
760660f
·
verified ·
1 Parent(s): 7d76bf3

Update googleGemini.js

Browse files
Files changed (1) hide show
  1. googleGemini.js +3 -3
googleGemini.js CHANGED
@@ -22,10 +22,10 @@ async function GeminiResponse(prompt) {
22
  model: "gemini-1.5-flash",
23
  });
24
  const result = await model.generateContent(prompt);
25
- console.log("Response:", result.response.candidates)
26
  const text = result.response.candidates[0]?.content;
27
- console.log("Results text:", text.parts)
28
- return text || "No response content";
29
  } catch (e) {
30
  console.error(`Error in GeminiResponse: ${e.message}`);
31
  return "Error generating response.";
 
22
  model: "gemini-1.5-flash",
23
  });
24
  const result = await model.generateContent(prompt);
25
+ // console.log("Response:", result.response.candidates)
26
  const text = result.response.candidates[0]?.content;
27
+ // console.log("Results text:", text.parts)
28
+ return text.parts[0].text || "No response content";
29
  } catch (e) {
30
  console.error(`Error in GeminiResponse: ${e.message}`);
31
  return "Error generating response.";