Back

Version 7

12/19/2024
import { GoogleGenerativeAI } from "https://esm.sh/@google/generative-ai";

const prompt = "What is the meaning of life?";
const genAI = new GoogleGenerativeAI(Deno.env.get("GEMINI_API_KEY"));

const model = genAI.getGenerativeModel(
{ model: "gemini-2.0-flash-exp" },
);
const result = await model.generateContent(prompt);
console.log(result.response.text());
Updated: December 19, 2024