feat(prompt): enhance question rewriting and intent classification in prompt templates

- Updated the prompt template to clarify the task of understanding and rewriting user questions, improving the instructions for coreference resolution and ellipsis completion.
- Renamed sections for better clarity, changing "Rewriting Goals" to "Query Understanding."
- Added critical notes for intent classification regarding image and document attachments, ensuring accurate processing based on the presence of attachments.
- Improved examples to reflect the updated intent classification logic, enhancing the overall user experience in query handling.
This commit is contained in:
wizardchen
2026-04-16 22:39:19 +08:00
committed by lyingbug
parent 53e8e17df4
commit 4f55994266
7 changed files with 297 additions and 241 deletions
@@ -321,9 +321,13 @@ func (p *PluginQueryUnderstand) buildPrompts(chatManage *types.ChatManage, histo
queryContent := chatManage.Query
if len(chatManage.Images) > 0 {
queryContent += fmt.Sprintf("\n\n<images_uploaded count=\"%d\" />", len(chatManage.Images))
} else {
queryContent += "\n\n<no_image_attached />"
}
if len(chatManage.Attachments) > 0 {
queryContent += chatManage.Attachments.BuildPrompt()
} else {
queryContent += "\n<no_document_attached />"
}
vals := types.PlaceholderValues{