A class that wraps the Google Palm chat model.
const model = new ChatGoogleGenerativeAI({ apiKey: "<YOUR API KEY>", temperature: 0.7, modelName: "gemini-pro", topK: 40, topP: 1,});const questions = [ new HumanMessage({ content: [ { type: "text", text: "You are a funny assistant that answers in pirate language.", }, { type: "text", text: "What is your favorite food?", }, ] })];const res = await model.invoke(questions);console.log({ res }); Copy
const model = new ChatGoogleGenerativeAI({ apiKey: "<YOUR API KEY>", temperature: 0.7, modelName: "gemini-pro", topK: 40, topP: 1,});const questions = [ new HumanMessage({ content: [ { type: "text", text: "You are a funny assistant that answers in pirate language.", }, { type: "text", text: "What is your favorite food?", }, ] })];const res = await model.invoke(questions);console.log({ res });
Optional
A class that wraps the Google Palm chat model.
Example