feat: enhance localization and configuration support

- Added timezone and language settings to the environment configuration.
- Introduced built-in agent configurations with multilingual support for various agents.
- Updated Docker Compose to utilize new environment variables for timezone and language.
- Created new prompt templates for question generation, summary generation, and keywords extraction.
This commit is contained in:
wizardchen
2026-03-17 15:33:19 +08:00
committed by lyingbug
parent 09d9fe5ddb
commit 139a9c40ff
54 changed files with 2524 additions and 1482 deletions
@@ -124,6 +124,7 @@ func (s *sessionService) KnowledgeQA(
ImageDescription: req.ImageDescription,
VLMModelID: vlmModelID,
ChatModelSupportsVision: chatModelSupportsVision,
Language: types.LanguageNameFromContext(ctx),
}
// Apply custom agent overrides (system prompt, temperature, retrieval params,
@@ -729,7 +730,10 @@ func (s *sessionService) renderFallbackPrompt(ctx context.Context, chatManage *t
if rq := strings.TrimSpace(chatManage.RewriteQuery); rq != "" {
query = rq
}
result := strings.ReplaceAll(chatManage.FallbackPrompt, "{{query}}", query)
result := types.RenderPromptPlaceholders(chatManage.FallbackPrompt, types.PlaceholderValues{
"query": query,
"language": chatManage.Language,
})
if chatManage.ImageDescription != "" && !chatManage.ChatModelSupportsVision {
result += "\n\n[用户上传图片内容]\n" + chatManage.ImageDescription