File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,24 @@ export async function askAI(params: ChatParams): Promise<FormState> {
3131
3232 try {
3333 const model = genAI . getGenerativeModel ( { model : "gemini-1.5-flash" } ) ;
34- const fullMessage = documentContent + "\n\n" + userQuestion ;
35- const result = await model . generateContent ( fullMessage ) ;
34+ const prompt = `
35+ 以下のPythonチュートリアルのドキュメントの内容を正確に理解し、ユーザーからの質問に対して、初心者にも分かりやすく、丁寧な解説を提供してください。
36+
37+ # ドキュメント
38+ ${ documentContent }
39+
40+ # ユーザーからの質問
41+ ${ userQuestion }
42+
43+ # 指示
44+ - 回答はMarkdown形式で記述し、コードブロックを適切に使用してください。
45+ - ドキュメントの内容に基づいて回答してください。
46+ - ユーザーへの回答のみを出力してください。
47+ - 必要であれば、具体的なコード例を提示してください。
48+ -
49+
50+ ` ;
51+ const result = await model . generateContent ( prompt ) ;
3652 const response = result . response ;
3753 const text = response . text ( ) ;
3854 return { response : text , error : null } ;
You can’t perform that action at this time.
0 commit comments