20251125 save
This commit is contained in:
parent
922fa0e77a
commit
092f2ec0f3
11 changed files with 299 additions and 1 deletions
38
functions/generate_minutes/src/logics/ai.ts
Normal file
38
functions/generate_minutes/src/logics/ai.ts
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import { GoogleGenAI } from "@google/genai";
|
||||
|
||||
|
||||
const aiClient = new GoogleGenAI({
|
||||
apiKey: process.env.GEMINI_API_KEY,
|
||||
});
|
||||
|
||||
export const aiController = {
|
||||
generateMinutes: async(text: string) => {
|
||||
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,
|
||||
})
|
||||
console.log("AI Response:", response.text);
|
||||
return response.text;
|
||||
} catch (error) {
|
||||
console.error("AI Generation Error:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue