From 2ad1faf85fe29b327a1239214cee9b84ac4120ce Mon Sep 17 00:00:00 2001 From: wizardchen Date: Tue, 17 Mar 2026 16:44:18 +0800 Subject: [PATCH] chore: update fallback templates - Added critical language rules to fallback response templates to ensure consistent language usage in responses. - Updated logger context to include language and session-related keys for improved context management. --- .gitmodules | 3 --- config/prompt_templates/fallback.yaml | 6 ++++++ internal/logger/logger.go | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index f0b37a08..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "WeKnora-Chrome-Extension"] - path = WeKnora-Chrome-Extension - url = https://git.woa.com/wxg-prc/xiaowei-openapi/WeKnora-Chrome-Extension.git diff --git a/config/prompt_templates/fallback.yaml b/config/prompt_templates/fallback.yaml index d6646883..8cfc5b48 100644 --- a/config/prompt_templates/fallback.yaml +++ b/config/prompt_templates/fallback.yaml @@ -28,6 +28,9 @@ templates: If you have other questions, I'm happy to continue helping you. + ## CRITICAL: Language Rule + - ALWAYS respond in {{language}} + - id: "polite_fallback" name: "Polite Fallback" description: "More polite and friendly fallback response" @@ -53,6 +56,9 @@ templates: Thank you for your understanding, and I look forward to helping you with other questions! + ## CRITICAL: Language Rule + - ALWAYS respond in {{language}} + - id: "brief_fallback" name: "Brief Fallback" description: "Short fallback response" diff --git a/internal/logger/logger.go b/internal/logger/logger.go index ed78113b..3eb08ee4 100644 --- a/internal/logger/logger.go +++ b/internal/logger/logger.go @@ -305,6 +305,9 @@ func CloneContext(ctx context.Context) context.Context { types.TenantInfoContextKey, types.UserIDContextKey, types.UserContextKey, + types.LanguageContextKey, + types.SessionTenantIDContextKey, + types.EmbedQueryContextKey, } { if v := ctx.Value(k); v != nil { newCtx = context.WithValue(newCtx, k, v)