Skip to content

Commit 75068e0

Browse files
krushnaroutclaude
andcommitted
fix move language instruction to dynamic message to preserve prompt caching
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 208c89b commit 75068e0

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

app/pubspec.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,10 @@ packages:
253253
dependency: transitive
254254
description:
255255
name: characters
256-
sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
256+
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
257257
url: "https://pub.dev"
258258
source: hosted
259-
version: "1.4.1"
259+
version: "1.4.0"
260260
checked_yaml:
261261
dependency: transitive
262262
description:
@@ -1457,18 +1457,18 @@ packages:
14571457
dependency: transitive
14581458
description:
14591459
name: matcher
1460-
sha256: "12956d0ad8390bbcc63ca2e1469c0619946ccb52809807067a7020d57e647aa6"
1460+
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
14611461
url: "https://pub.dev"
14621462
source: hosted
1463-
version: "0.12.18"
1463+
version: "0.12.17"
14641464
material_color_utilities:
14651465
dependency: transitive
14661466
description:
14671467
name: material_color_utilities
1468-
sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
1468+
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
14691469
url: "https://pub.dev"
14701470
source: hosted
1471-
version: "0.13.0"
1471+
version: "0.11.1"
14721472
mcumgr_flutter:
14731473
dependency: "direct main"
14741474
description:
@@ -2219,10 +2219,10 @@ packages:
22192219
dependency: transitive
22202220
description:
22212221
name: test_api
2222-
sha256: "19a78f63e83d3a61f00826d09bc2f60e191bf3504183c001262be6ac75589fb8"
2222+
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
22232223
url: "https://pub.dev"
22242224
source: hosted
2225-
version: "0.7.8"
2225+
version: "0.7.7"
22262226
time:
22272227
dependency: transitive
22282228
description:

backend/utils/llm/conversation_processing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,8 +641,8 @@ def get_transcript_structure(
641641
response_language = output_language_code or language_code
642642

643643
# First system message: task-specific instructions (static prefix enables cross-conversation caching)
644+
# NOTE: language instructions are in context_message (second message) to keep this prefix fully static.
644645
instructions_text = '''You are an expert content analyzer. Your task is to analyze the provided content (which could be a transcript, a series of photo descriptions from a wearable camera, or both) and provide structure and clarity.
645-
The content language is {language_code}. You MUST respond entirely in {response_language}.
646646
647647
CRITICAL: If CALENDAR MEETING CONTEXT is provided with participant names, you MUST use those names:
648648
- The conversation DEFINITELY happened between the named participants
@@ -687,7 +687,7 @@ def get_transcript_structure(
687687
).strip()
688688

689689
# Second system message: conversation context (dynamic, per-conversation)
690-
context_message = 'Content:\n{conversation_context}'
690+
context_message = 'The content language is {language_code}. You MUST respond entirely in {response_language}.\n\nContent:\n{conversation_context}'
691691
prompt = ChatPromptTemplate.from_messages([('system', instructions_text), ('system', context_message)])
692692
chain = prompt | llm_medium_experiment.bind(prompt_cache_key="omi-transcript-structure") | parser
693693

0 commit comments

Comments
 (0)