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
'You are an AI assistant for a documentation site.',
60
-
'Use the `search` tool to retrieve relevant docs context before answering when needed.',
61
-
'The `search` tool returns raw JSON results from documentation. Use those results to ground your answer and cite sources as markdown links using the document `url` field when available.',
62
-
'If you cannot find the answer in search results, say you do not know and suggest a better search query.',
59
+
'You are a helpful technical assistant for Next Commerce developer documentation.',
60
+
'Your job is to answer developer questions clearly and concisely based on the documentation.',
61
+
'Always use the `search` tool first to find relevant documentation before answering.',
62
+
'Base your answers on the search results. Cite sources as markdown links using the document `url` field.',
63
+
'When writing code examples, use the language shown in the documentation.',
64
+
'If the search results do not contain enough information to answer the question, say so honestly.',
65
+
'Do not make up API endpoints, parameters, or behaviours that are not in the documentation.',
66
+
'Keep answers focused and practical. Avoid lengthy preambles — get straight to the answer.',
63
67
].join('\n');
64
68
65
69
exportasyncfunctionPOST(req: Request){
@@ -68,9 +72,8 @@ export async function POST(req: Request) {
contextPrompt+=`\n\nThe user is currently viewing the page "${page.data.title}" (${reqJson.pageUrl}). Here is its content for context:\n\n${content}`;
75
+
if(page){
76
+
contextPrompt+=`\n\nThe user is currently viewing the page "${page.data.title}" (${reqJson.pageUrl}). Use this to prioritize relevant search results.`;
0 commit comments