-
Notifications
You must be signed in to change notification settings - Fork 14
fix: update block translation prompt to handle bible references #8639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: update block translation prompt to handle bible references #8639
Conversation
WalkthroughAdds Bible-specific handling to journeyAiTranslate prompts: do not translate Bible content; use prior journey analysis translation or default to a popular English translation if unavailable. Translate Bible references (book names and separators) to target language. Applies at card-level and batch translation while preserving IDs and existing flow. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
502 Bad Gatewaycloudflare Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
View your CI Pipeline Execution ↗ for commit d6e1273
☁️ Nx Cloud last updated this comment at |
|
I see you added the "on stage" label, I'll get this merged to the stage branch! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In
`@apis/api-journeys-modern/src/schema/journeyAiTranslate/journeyAiTranslate.ts`:
- Around line 369-374: Update the prompt text in the "IMPORTANT - Bible Content
Handling" prompt block by removing the duplicated word "the" so the sentence
reads "If there is no Bible translation available, use the most popular English
Bible translation available." Locate the prompt string containing the exact
phrase "IMPORTANT - Bible Content Handling" in journeyAiTranslate.ts and edit
that constant or template literal (where the prompt is defined) to correct "use
the the" → "use the".
- Around line 369-385: The cardAnalysisPrompt used in the mutation flow is
missing the Bible content handling rules, causing inconsistent behavior; update
the mutation prompt in journeyAiTranslate.ts by either (a) copying the entire
Bible handling block (the "IMPORTANT - Bible Content Handling" section) into the
cardAnalysisPrompt definition so it enforces: do not translate Bible passages,
reuse previous journey Bible translations or default to a popular English
translation if missing, and translate Bible REFERENCES (book names +
chapter:verse) adapting book names and separators for the target language; or
(b) better, extract that Bible handling text into a shared constant (e.g.,
BIBLE_REFERENCE_PROMPT_SNIPPET) and include that constant in both the
subscription prompt and cardAnalysisPrompt to ensure both flows use identical
rules. Ensure you reference and update the cardAnalysisPrompt symbol in
journeyAiTranslate.ts.
apis/api-journeys-modern/src/schema/journeyAiTranslate/journeyAiTranslate.ts
Show resolved
Hide resolved
| IMPORTANT - Bible Content Handling: | ||
| - If you are in the process of translating and you recognize passages from the | ||
| Bible you should not translate that content. Instead, you should rely on a Bible | ||
| translation available from the previous journey analysis and use that content directly. | ||
| You must never make changes to content from the Bible yourself. | ||
| If there is no Bible translation was available, use the the most popular English Bible translation available. | ||
| If there is no Bible translation available, use the the most popular English Bible translation available. | ||
|
|
||
| - Bible REFERENCES (book names like "Luke", "Mark", "James" followed by chapter:verse | ||
| notation like "2:10" or "13:1") MUST be translated to the target language. | ||
| Examples: "Luke 2:10" should become "Lucas 2:10" in Spanish, "Lukas 2,10" in German | ||
| (note German uses comma instead of colon). Translate the book name and adapt the | ||
| chapter:verse separator to match the target language's conventions. | ||
|
|
||
| - References may appear in various formats (e.g., "Luke 2:10", "Luke 2:10-12", | ||
| "Mark 10:1, 3"). Always translate the book name and preserve the reference structure | ||
| while adapting formatting to the target language. | ||
| ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep Bible-reference rules consistent across translation flows.
Only the subscription path gets the new Bible-reference rules. The mutation path (cardAnalysisPrompt) still lacks them, so behavior diverges based on which API is used. Please mirror the same rules there (or extract a shared prompt snippet).
🛠️ Suggested patch (mutation prompt)
-If there is no Bible translation was available, use the the most popular English Bible translation available.
+If there is no Bible translation available, use the most popular English Bible translation available.
+
+Bible REFERENCES (book names like "Luke", "Mark", "James" followed by chapter:verse
+notation like "2:10" or "13:1") MUST be translated to the target language.
+Examples: "Luke 2:10" should become "Lucas 2:10" in Spanish, "Lukas 2,10" in German
+(note German uses comma instead of colon). Translate the book name and adapt the
+chapter:verse separator to match the target language's conventions.
+
+References may appear in various formats (e.g., "Luke 2:10", "Luke 2:10-12",
+"Mark 10:1, 3"). Always translate the book name and preserve the reference structure
+while adapting formatting to the target language.🤖 Prompt for AI Agents
In `@apis/api-journeys-modern/src/schema/journeyAiTranslate/journeyAiTranslate.ts`
around lines 369 - 385, The cardAnalysisPrompt used in the mutation flow is
missing the Bible content handling rules, causing inconsistent behavior; update
the mutation prompt in journeyAiTranslate.ts by either (a) copying the entire
Bible handling block (the "IMPORTANT - Bible Content Handling" section) into the
cardAnalysisPrompt definition so it enforces: do not translate Bible passages,
reuse previous journey Bible translations or default to a popular English
translation if missing, and translate Bible REFERENCES (book names +
chapter:verse) adapting book names and separators for the target language; or
(b) better, extract that Bible handling text into a shared constant (e.g.,
BIBLE_REFERENCE_PROMPT_SNIPPET) and include that constant in both the
subscription prompt and cardAnalysisPrompt to ensure both flows use identical
rules. Ensure you reference and update the cardAnalysisPrompt symbol in
journeyAiTranslate.ts.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.