39 lines
No EOL
1.7 KiB
TypeScript
39 lines
No EOL
1.7 KiB
TypeScript
import { GoogleGenAI } from "@google/genai";
|
|
|
|
|
|
const aiClient = new GoogleGenAI({
|
|
apiKey: process.env.GEMINI_API_KEY,
|
|
});
|
|
|
|
export const aiController = {
|
|
generateMinutes: async(text: string): Promise<string | null> => {
|
|
const prompt = `
|
|
あなたは議事録作成のプロフェッショナルです。以下の「文字起こし結果」は営業マンが録音した商談の文字起こしです。以下の制約条件に従い、最高の商談報告の議事録を作成してください。
|
|
|
|
制約条件:
|
|
1. 文字起こし結果にはAIによる書き起こしミスがある可能性を考慮してください。
|
|
2. 冒頭に主要な「決定事項」と「アクションアイテム」をまとめてください。
|
|
3. 議論のポイントを議題ごとに要約してください。
|
|
4. 見出しや箇条書きを用いて、情報が探しやすい構造で簡潔かつ明瞭に記述してください。
|
|
5. 要約は500文字以内に収めてください。
|
|
6. 箇条書き形式で簡潔にまとめてください。
|
|
7. マークダウン記法は使わず、各項目を「■」や「・」等を使って見やすくしてください。
|
|
|
|
文字起こし結果:
|
|
${text}
|
|
`
|
|
|
|
try {
|
|
const response = await aiClient.models.generateContent({
|
|
model: process.env.GEMINI_MODEL_ID || "gemini-2.5-flash",
|
|
contents: prompt,
|
|
})
|
|
if(!response.text) return null;
|
|
console.log("AI Response:", response.text);
|
|
return response.text;
|
|
} catch (error) {
|
|
console.error("AI Generation Error:", error);
|
|
return null;
|
|
}
|
|
}
|
|
}; |