100xdocs
100xdocs copied to clipboard
[FEAT]: Add calls to GAI preferably [Gemini] for docs-bot
Description
The APIs are now generally available and have a generous free tier with upto 60 request per minute.
Quickstart to consuming the library
const { GoogleGenerativeAI } = require("@google/generative-ai");
// Access your API key as an environment variable (see "Set up your API key" above)
const genAI = new GoogleGenerativeAI(process.env.API_KEY);
async function run() {
// For text-only input, use the gemini-pro model
const model = genAI.getGenerativeModel({ model: "gemini-pro"});
const prompt = "Write a story about a magic backpack."
const result = await model.generateContent(prompt);
const response = await result.response;
const text = response.text();
console.log(text);
}
run();
https://ai.google.dev/tutorials/node_quickstart
Additional Information
No response