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
@@ -71,9 +71,13 @@ export async function POST(req: NextRequest) {
71
71
}
72
72
73
73
// Update system prompt to reflect we're using structured data
74
-
constenhancedSystemPrompt=systemPrompt
75
-
? `${systemPrompt}\n\nIMPORTANT: Return a valid structured object according to the provided schema. DO NOT use markdown formatting such as code blocks with backticks (\`\`\`). The response must be pure, parseable JSON without any markdown formatting or extra text surrounding it. Ensure all special characters in strings are properly escaped according to JSON standards.`
76
-
: "IMPORTANT: Return a valid structured object according to the provided schema. DO NOT use markdown formatting such as code blocks with backticks (```). The response must be pure, parseable JSON without any markdown formatting or extra text surrounding it. Ensure all special characters in strings are properly escaped according to JSON standards.";
`${systemPrompt}\n\nIMPORTANT: Format your response as pure markdown. DO NOT wrap your entire response in markdown code blocks with \`\`\`markdown tags. The output should be directly renderable as markdown.`
77
+
: "Format your response as pure markdown. DO NOT wrap your entire response in markdown code blocks with ```markdown tags. The output should be directly renderable as markdown."
78
+
: systemPrompt
79
+
? `${systemPrompt}\n\nIMPORTANT: Return a valid structured object according to the provided schema. DO NOT use markdown formatting such as code blocks with backticks (\`\`\`). The response must be pure, parseable JSON without any markdown formatting or extra text surrounding it. Ensure all special characters in strings are properly escaped according to JSON standards.`
80
+
: "IMPORTANT: Return a valid structured object according to the provided schema. DO NOT use markdown formatting such as code blocks with backticks (```). The response must be pure, parseable JSON without any markdown formatting or extra text surrounding it. Ensure all special characters in strings are properly escaped according to JSON standards.";
Your answer should be clear, efficient, and follow best practices.
190
198
If it's a coding question, include well-commented code.
191
199
If it's a conceptual question, provide a comprehensive explanation.
192
-
Return your answer in both English and Chinese.
193
-
194
-
IMPORTANT: Return pure, parseable JSON without any markdown formatting. DO NOT wrap your response in code blocks with backticks (\`\`\`json or any other format).
195
-
The response MUST be directly parseable as JSON without any cleanup needed.
196
-
Ensure all special characters in strings are properly escaped according to JSON standards.
197
200
198
-
When including code examples in your answer, make sure to properly escape them as JSON strings.
199
-
For example, if you need to include a code snippet with backticks, escape them properly in the JSON.${codeLanguage ? `\n\nIf code is required in the answer, prefer to use ${codeLanguage} programming language unless the question specifically requires a different language.` : ''}`;
201
+
IMPORTANT: You should format your response as markdown text. Use markdown features like **bold**, *italic*, code blocks with \`\`\` for code examples, and other formatting to make your answer clear and readable.
202
+
When including code examples, use proper markdown code blocks with language specification, e.g. \`\`\`javascript.
203
+
DO NOT wrap your entire response in a markdown code block. Your response should be pure markdown without outer \`\`\`markdown tags.
204
+
${codeLanguage ? `\n\nIf code is required in the answer, prefer to use ${codeLanguage} programming language unless the question specifically requires a different language.` : ''}`;
0 commit comments