UI Stabilization: Global color theme updates (#75B2D6), AI Assistant styling refactor, and navigation fixes
This commit is contained in:
@@ -10,7 +10,7 @@ export async function POST(request: NextRequest) {
|
||||
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
|
||||
}
|
||||
|
||||
const { existingContent, resourceText, mode, language } = await request.json()
|
||||
const { existingContent, resourceText, mode, language, format } = await request.json()
|
||||
|
||||
if (!resourceText || typeof resourceText !== 'string') {
|
||||
return NextResponse.json({ error: 'resourceText is required' }, { status: 400 })
|
||||
@@ -20,6 +20,7 @@ export async function POST(request: NextRequest) {
|
||||
}
|
||||
|
||||
const lang = language || 'fr'
|
||||
const outputFormat = format === 'html' ? 'HTML (with proper tags like <h2>, <p>, <ul>, <li>)' : 'Markdown (with ##, -, **, etc.)'
|
||||
const config = await getSystemConfig()
|
||||
const provider = getTagsProvider(config)
|
||||
|
||||
@@ -30,6 +31,7 @@ export async function POST(request: NextRequest) {
|
||||
prompt = `You are an expert note editor. Your task is to enrich an existing note by adding relevant information from a provided resource, WITHOUT modifying or rewriting the existing content.
|
||||
|
||||
LANGUAGE RULE: Respond in ${lang}. Match the language of the existing note.
|
||||
FORMAT RULE: Respond in ${outputFormat}.
|
||||
|
||||
EXISTING NOTE:
|
||||
---
|
||||
@@ -46,13 +48,14 @@ INSTRUCTIONS:
|
||||
- Append ONLY new, non-redundant information from the resource below the existing content
|
||||
- Use a clear separator (e.g., "---" or a new section heading) between existing and new content
|
||||
- Skip information already covered in the existing note
|
||||
- Format the new content consistently with the existing note style
|
||||
- Format the new content consistently with the existing note style and the requested FORMAT RULE
|
||||
- Respond ONLY with the enriched note content, no explanations`
|
||||
} else {
|
||||
// Merge: intelligently rewrite integrating both sources
|
||||
prompt = `You are an expert note writer. Your task is to intelligently merge an existing note with a resource into a single, coherent, well-structured document.
|
||||
|
||||
LANGUAGE RULE: Respond in ${lang}. Match the language of the existing note.
|
||||
FORMAT RULE: Respond in ${outputFormat}.
|
||||
|
||||
EXISTING NOTE:
|
||||
---
|
||||
@@ -69,7 +72,7 @@ INSTRUCTIONS:
|
||||
- Eliminate redundancy — include each piece of information only once
|
||||
- Preserve the key ideas from both sources
|
||||
- Maintain a logical structure with clear headings if appropriate
|
||||
- Keep the tone and style consistent
|
||||
- Keep the tone and style consistent with the requested FORMAT RULE
|
||||
- Respond ONLY with the merged content, no meta-commentary or explanations`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user