Generative AI with Node.js in Hindi #15 Gemini Basic Config Params Explained #generativeai #nodejs

Basic Config with Gemini

Steps:-

  1. systemInstruction
  2. thinkingConfig
  3. includeThoughts
  4. thinkingBudget
  5. temperature
  6. Interview Question
  7. Code and Notes



Code:-


import {GoogleGenAI} from '@google/genai'
import dotenv from 'dotenv'
dotenv.config();

const googleAI = new GoogleGenAI({apiKey:process.env.geminiKey})

async function main(){
const response = await googleAI.models.generateContent({
model:"gemini-2.5-flash",
contents:"what can i wear in a party ",
config:{
temperature:2.0,
// thinkingConfig:{
// includeThoughts:true,
// thinkingBudget:100
// }
systemInstruction:"give simple answers 100 words "
}
})
console.log(response.text)
}

main()