chatwoot/lib/captain
Petterson b7b6e67df7
fix(captain): localize AI summary to account language (#13790)
AI-generated summaries now respect the account's language setting.
Previously, summaries were always returned in English regardless of the
user's configured language, making section headings like "Customer
Intent" and "Action Items" appear in English even for non-English
accounts.

Previous behavior:
<img width="1336" height="790" alt="image"
src="https://github.com/user-attachments/assets/5df8b78b-1218-438d-9578-a806b5cb94ac"
/>


Current Behavior: 
<img width="1253" height="372" alt="image"
src="https://github.com/user-attachments/assets/ae932c97-06da-4baf-9f77-9719bc9162e8"
/>


## What changed
- Added explicit account locale to the AI system prompt in
`Captain::SummaryService`
- Updated the summary prompt template to instruct the model to translate
section headings

## How to test
1. Configure an account with a non-English language (e.g., Portuguese)
2. Open a conversation with messages
3. Use the Copilot "Summarize" feature
4. Verify that section headings ("Customer Intent", "Conversation
Summary", etc.) appear in the account's language

---------

Co-authored-by: Aakash Bakhle <48802744+aakashb95@users.noreply.github.com>
2026-04-14 17:36:10 +05:30
..
base_task_service.rb fix: log only on system api key failures (#13968) 2026-04-09 18:04:52 +05:30
csat_utility_analysis_service.rb feat(csat): Add WhatsApp utility template analyzer with rewrite guidance (#13575) 2026-02-24 15:11:04 +04:00
follow_up_service.rb feat: new Captain Editor (#13235) 2026-01-21 13:39:07 +05:30
label_suggestion_service.rb feat: new Captain Editor (#13235) 2026-01-21 13:39:07 +05:30
reply_suggestion_service.rb feat: search documentation tool for reply suggestions (#13340) 2026-01-30 16:18:33 +05:30
rewrite_service.rb feat: new Captain Editor (#13235) 2026-01-21 13:39:07 +05:30
summary_service.rb fix(captain): localize AI summary to account language (#13790) 2026-04-14 17:36:10 +05:30
tool_instrumentation.rb feat: langfuse logging improvements (#13534) 2026-02-17 13:30:04 +05:30