feature/ Surprise challenge #2 - AI pun button added and basic suggestion integrated in the plans
This commit is contained in:
1 parent
79f0caa3c1
commit
206b31e785
7 files changed
+563
-4
No files matched your search
@@ -0,0 +1,24 @@
|
||||
const { GoogleGenAI } = require("@google/genai");
|
||||
|
||||
const ai = new GoogleGenAI({ apiKey: process.env.GOOGLE_API_KEY });
|
||||
|
||||
async function generatePun() {
|
||||
const response = await ai.models.generateContent({
|
||||
model: "gemini-2.0-flash",
|
||||
contents: "Return a funny pun about investments, answer the pun only, no additional text.",
|
||||
});
|
||||
return response.text;
|
||||
}
|
||||
|
||||
async function generateSuggestions() {
|
||||
const response = await ai.models.generateContent({
|
||||
model: "gemini-2.0-flash",
|
||||
contents: "Return a mock investment suggestion 3-5 lines only",
|
||||
});
|
||||
return response.text;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
generatePun,
|
||||
generateSuggestions
|
||||
};
|
||||
Reference in new issue
Block a user