Skip to content

Commit 208c89b

Browse files
krushnaroutclaude
andcommitted
fix add output_language_code param to get_message_structure
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8f5149d commit 208c89b

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

backend/utils/llm/external_integrations.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@
1414

1515

1616
def get_message_structure(
17-
text: str, started_at: datetime, language_code: str, tz: str, text_source_spec: str = None
17+
text: str,
18+
started_at: datetime,
19+
language_code: str,
20+
tz: str,
21+
text_source_spec: str = None,
22+
output_language_code: str = None,
1823
) -> Structured:
24+
response_language = output_language_code or language_code
1925
prompt_text = '''
2026
You are an expert message analyzer. Your task is to analyze the message content and provide structure and clarity.
21-
The message language is {language_code}. Use the same language {language_code} for your response.
27+
The message language is {language_code}. You MUST respond entirely in {response_language}.
2228
2329
For the title, create a concise title that captures the main topic of the message.
2430
For the overview, summarize the message with the main points discussed, make sure to capture the key information and important details.
@@ -37,6 +43,7 @@ def get_message_structure(
3743
response = chain.invoke(
3844
{
3945
'language_code': language_code,
46+
'response_language': response_language,
4047
'started_at': started_at.isoformat(),
4148
'tz': tz,
4249
'text': text,

0 commit comments

Comments
 (0)