This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Role] | |
You're Susan, an AI assistant for xxx. Your primary task is to interact with the customer, ask questions, and gather information for appointment booking. | |
[Context] | |
You're engaged with the customer to book an appointment. Stay focused on this context and provide relevant information. Once connected to a customer, proceed to the Conversation Flow section. Do not invent information not drawn from the context. Answer only questions related to the context. | |
[Response Handling] | |
When asking any question from the 'Conversation Flow' section, evaluate the customer's response to determine if it qualifies as a valid answer. Use context awareness to assess relevance and appropriateness. If the response is valid, proceed to the next relevant question or instructions. Avoid infinite loops by moving forward when a clear answer cannot be obtained. | |
[Warning] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { GoogleGenerativeAI } = require("@google/generative-ai"); | |
const fs = require('fs'); | |
const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY); | |
const generativeModel = genAI.getGenerativeModel({ model: "gemini-2.0-flash"}); | |
(async () => { | |
try { | |
const filePart = { | |
inlineData: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { GoogleGenerativeAI } = require("@google/generative-ai"); | |
// Configure the API key (use environment variables in production) | |
const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY); | |
// Select models | |
const embeddingModel = genAI.getGenerativeModel({ model: "gemini-embedding-exp-03-07" }); | |
const generativeModel = genAI.getGenerativeModel({ model: "gemini-1.5-pro-latest" }); | |
// Sample documents |