Skip to content

Instantly share code, notes, and snippets.

@yungwarlock
Created May 22, 2025 19:42
Show Gist options
  • Save yungwarlock/d510c3555f12cae261d7b793fac1d2c9 to your computer and use it in GitHub Desktop.
Save yungwarlock/d510c3555f12cae261d7b793fac1d2c9 to your computer and use it in GitHub Desktop.
// To run this code you need to install the following dependencies:
// npm install @google/genai mime
// npm install -D @types/node
import { GoogleGenAI } from '@google/genai';
async function callGemini(prompt, document) {
const ai = new GoogleGenAI({
apiKey: process.env.GEMINI_API_KEY,
});
const config = {
responseMimeType: 'text/plain',
};
const model = 'gemini-1.5-pro';
const contents = [
{
role: 'user',
parts: [
{ text: prompt },
{ text: document },
],
},
];
const response = await ai.models.generateContent({
model,
config,
contents,
});
return response.text;
}
async function extractProjectGoal(document) {
const prompt = ""
return await callGemini(prompt, document);
}
// Convert speech to text
const stt = ""
const main = async (stt) => {
const res = {
"projectGoal": await extractProjectGoal(stt),
"targetPersona": "",
"": ""
}
return res
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment