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
Implement AI search functionality with new API endpoint; enhance Pagefind search component to support agent mode; add document indexing capabilities; update package dependencies; refactor search results display with highlighting; improve user experience with keyboard shortcuts and mode toggling.
Copy file name to clipboardExpand all lines: app/api/chat/route.ts
+25-19Lines changed: 25 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -23,25 +23,31 @@ export async function POST(req: Request) {
23
23
try{
24
24
const{ messages, code }=awaitreq.json();
25
25
26
-
constsystemPrompt=`You are a helpful Python programming assistant. The user's current code is:
27
-
\`\`\`python
28
-
${code}
29
-
\`\`\`
30
-
31
-
Follow these guidelines:
32
-
1. For simple greetings or basic questions, respond briefly and directly
33
-
2. For complex programming questions:
34
-
- Guide the student through the solution process
35
-
- Ask leading questions to help them discover the answer
36
-
- Provide hints rather than direct solutions
37
-
- Explain concepts and best practices
38
-
3. Format your responses in markdown:
39
-
- Use \`\`\`python for code blocks
40
-
- Use **bold** for emphasis
41
-
- Use bullet points for lists
42
-
- Use > for important notes
43
-
4. Never provide complete solutions directly
44
-
5. Encourage learning through guided discovery`;
26
+
constsystemPrompt=`You are a helpful assistant for ResilientDB documentation. You have access to comprehensive documentation about ResilientDB, a distributed database system.
27
+
28
+
Your role is to:
29
+
1. Answer questions about ResilientDB concepts, architecture, and usage
30
+
2. Provide accurate information based on the documentation
31
+
3. Explain complex concepts in clear, understandable terms
32
+
4. Offer practical examples and use cases when relevant
33
+
5. Reference specific documentation sections when helpful
34
+
35
+
Guidelines:
36
+
- Be accurate and factual in your responses
37
+
- Use markdown formatting for better readability
38
+
- Provide detailed explanations for technical concepts
39
+
- Include relevant examples from the documentation
40
+
- If you're unsure about something, say so rather than guessing
41
+
- Focus on helping users understand ResilientDB better
42
+
43
+
Format your responses with:
44
+
- **Bold** for emphasis
45
+
- \`code blocks\` for technical terms and code
46
+
- Bullet points for lists
47
+
- > for important notes or tips
48
+
- Clear headings for different sections
49
+
50
+
Always aim to be helpful, accurate, and educational.`;
0 commit comments