feat: use language-neutral English prompts for multilingual LLM responses
Convert all LLM-facing prompts, templates, and tool output labels to language-neutral English so the model responds in the user's input language. Update frontend relevance/match-type mappings to match. Output language strategy: - User-facing: reply in user's input language - Vector-indexed: match source document language - LLM-internal: fixed English
This commit is contained in:
@@ -241,19 +241,19 @@ func (a *CustomAgent) IsAgentMode() bool {
|
||||
func GetBuiltinQuickAnswerAgent(tenantID uint64) *CustomAgent {
|
||||
return &CustomAgent{
|
||||
ID: BuiltinQuickAnswerID,
|
||||
Name: "快速问答",
|
||||
Description: "基于知识库的 RAG 问答,快速准确地回答问题",
|
||||
Name: "Quick Answer",
|
||||
Description: "Knowledge base RAG Q&A for fast and accurate answers",
|
||||
IsBuiltin: true,
|
||||
TenantID: tenantID,
|
||||
Config: CustomAgentConfig{
|
||||
AgentMode: AgentModeQuickAnswer,
|
||||
SystemPrompt: "",
|
||||
ContextTemplate: `请根据以下参考资料回答用户问题。
|
||||
ContextTemplate: `Answer the user's question based on the following reference materials. IMPORTANT: Always respond in the same language as the user's question.
|
||||
|
||||
参考资料:
|
||||
Reference materials:
|
||||
{{contexts}}
|
||||
|
||||
用户问题:{{query}}`,
|
||||
User question: {{query}}`,
|
||||
Temperature: 0.7,
|
||||
MaxCompletionTokens: 2048,
|
||||
WebSearchEnabled: true,
|
||||
@@ -284,8 +284,8 @@ func GetBuiltinQuickAnswerAgent(tenantID uint64) *CustomAgent {
|
||||
func GetBuiltinSmartReasoningAgent(tenantID uint64) *CustomAgent {
|
||||
return &CustomAgent{
|
||||
ID: BuiltinSmartReasoningID,
|
||||
Name: "智能推理",
|
||||
Description: "ReAct 推理框架,支持多步思考和工具调用",
|
||||
Name: "Smart Reasoning",
|
||||
Description: "ReAct reasoning framework with multi-step thinking and tool calling",
|
||||
IsBuiltin: true,
|
||||
TenantID: tenantID,
|
||||
Config: CustomAgentConfig{
|
||||
@@ -321,8 +321,8 @@ func GetBuiltinSmartReasoningAgent(tenantID uint64) *CustomAgent {
|
||||
func GetBuiltinDataAnalystAgent(tenantID uint64) *CustomAgent {
|
||||
return &CustomAgent{
|
||||
ID: BuiltinDataAnalystID,
|
||||
Name: "数据分析师",
|
||||
Description: "专业数据分析智能体,支持 CSV/Excel 文件的 SQL 查询与统计分析",
|
||||
Name: "Data Analyst",
|
||||
Description: "Professional data analysis agent with SQL query and statistical analysis for CSV/Excel files",
|
||||
Avatar: "📊",
|
||||
IsBuiltin: true,
|
||||
TenantID: tenantID,
|
||||
|
||||
Reference in New Issue
Block a user