You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
? `for the course "${courseInfo.courseName}"${courseInfo.courseDescription ? ` (${courseInfo.courseDescription})` : ''}. Use general academic knowledge relevant to this course`
57
+
: 'using general academic knowledge'
47
58
48
59
return`
49
-
Your job is to generate diverse and interesting FAQs with question answer pairs based on the context provided.
60
+
Your job is to generate diverse and interesting FAQs with question answer pairs ${contextInstruction}.
50
61
51
62
Format ALL FAQs as a JSON object with this structure:
4. Focus on different aspects of the content - find unique angles and insights.
66
77
5. Ensure all quotes and special characters in the JSON are properly escaped.
67
78
6. The JSON must be valid and parsable without errors.
68
-
7. Answers should be detailed, descriptive, and provide clear explanations based on the context.
79
+
7. Answers should be detailed, descriptive, and provide clear explanations${hasValidSources ? ' based on the context' : ''}.
80
+
${!hasValidSources&&courseInfo?.courseName ? `8. Focus on questions and answers that would be relevant for students in ${courseInfo.courseName}.` : ''}
69
81
`
70
82
}
71
83
@@ -233,8 +245,13 @@ export async function POST(req: Request) {
233
245
continueFaqs =false,
234
246
useReranker,// Add this line with default value true
? `Generate FAQs for the course "${courseInfo.courseName}"${userQuery ? ` related to: "${userQuery}"` : ''}. Use general academic knowledge relevant to this course.`
335
+
: `Generate FAQs${userQuery ? ` for the topic: "${userQuery}"` : ''}. Use general academic knowledge to provide comprehensive answers.`
return`Generate FAQs for the following query: "${query}". Use the provided context to answer.`
394
+
}elseif(courseInfo?.courseName){
395
+
return`Generate FAQs for the course "${courseInfo.courseName}"${query ? ` related to: "${query}"` : ''}. Use general academic knowledge relevant to this course.`
396
+
}else{
397
+
return`Generate FAQs${query ? ` for the topic: "${query}"` : ''}. Use general academic knowledge to provide comprehensive answers.`
0 commit comments