Skip to content

feat: add Hinglish language support with custom prompting and improve…#243

Open
janakkapadia wants to merge 7 commits into
zachlatta:mainfrom
janakkapadia:main
Open

feat: add Hinglish language support with custom prompting and improve…#243
janakkapadia wants to merge 7 commits into
zachlatta:mainfrom
janakkapadia:main

Conversation

@janakkapadia

@janakkapadia janakkapadia commented Jun 24, 2026

Copy link
Copy Markdown

…d post-processing patterns

Summary by CodeRabbit

  • New Features
    • Added mixed-language options for both transcription and output, including Hinglish and Gujlish.
    • Enhanced transcription with optional guidance to improve mixed-script code-switching.
  • Bug Fixes
    • Improved handling for Hinglish/Gujlish so results are processed in the intended English/Latin script.
    • Strengthened output rules to preserve Hinglish/Gujlish (no automatic conversion to native scripts) and added an extra strict self-correction example.
  • Chores
    • Updated app version to 1.1.0.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds prompt support to transcription uploads, routes Hinglish and Gujlish through English transcription with custom prompts, expands language pickers, tightens post-processing instructions for Latin-script mixed-language output, and updates app version metadata.

Changes

Mixed-language transcription support

Layer / File(s) Summary
TranscriptionService optional prompt field
Sources/TranscriptionService.swift
Adds optional prompt storage and initialization, trims empty prompts to nil, passes the prompt into multipart upload construction, and conditionally emits a prompt form field.
AppState mixed-language wiring and Settings picker options
Sources/AppState.swift, Sources/SettingsView.swift
Adds Hinglish and Gujlish transcription options, resolves both to en with mixed-language prompts in transcription service creation, and expands the output-language picker with Hindi, Hinglish, Gujarati, and Gujlish.
Post-processing mixed-language prompt enforcement
Sources/PostProcessingService.swift
Requires Hinglish and Gujlish to stay in Latin script, adds a Hindi/Hinglish correction example, updates the prompt date, and extends output-language instructions for Hinglish and Gujlish.
App version metadata bump
Info.plist
Updates CFBundleVersion and CFBundleShortVersionString to 1.1.0.

Sequence Diagram(s)

sequenceDiagram
  participant SettingsView
  participant AppState
  participant TranscriptionService
  participant PostProcessingService

  SettingsView->>AppState: set transcriptionLanguage to Hinglish or Gujlish
  AppState->>TranscriptionService: init(language: "en", prompt: mixed-language prompt)
  TranscriptionService-->>AppState: transcribed English-script text
  AppState->>PostProcessingService: applyOutputLanguage(Hinglish or Gujlish)
  PostProcessingService-->>AppState: output restricted to Latin-script mixed language
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • zachlatta/freeflow#103: Modifies the same AppState.makeTranscriptionService() and transcription service construction path changed here.
  • zachlatta/freeflow#102: Changes PostProcessingService.applyOutputLanguage, which this PR extends with Hinglish and Gujlish output instructions.
  • zachlatta/freeflow#195: Updates PostProcessingService.defaultSystemPrompt, the same prompt contract area edited here.

Poem

🐇 I nibbled words in scripts just so,
Hinglish and Gujlish softly glow.
A prompt hopped in beside the sound,
Latin letters stayed tightly bound,
And carrots cheered: “The phrases flow!”

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change by calling out Hinglish support and custom prompting, which are central to the patch.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Makefile`:
- Line 96: The DMG recipe still includes a lingering fileicon step, so remove
the fileicon invocation from the Makefile’s DMG build target and keep the rest
of the staging/package flow intact. Use the DMG-related recipe around the build
target to locate the exact shell command and ensure no other references to
fileicon remain in that target.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d9e324fe-9e7e-4a7d-805d-240beb5475c3

📥 Commits

Reviewing files that changed from the base of the PR and between 13e2788 and 3b388e3.

📒 Files selected for processing (5)
  • Makefile
  • Sources/AppState.swift
  • Sources/PostProcessingService.swift
  • Sources/SettingsView.swift
  • Sources/TranscriptionService.swift

Comment thread Makefile Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
Sources/AppState.swift (2)

1012-1023: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Redundant "en" mapping in two places.

resolvedTranscriptionLanguage already resolves hinglish/gujlish to "en", so the isMixedLanguage ? "en" : resolvedTranscriptionLanguage ternary at Line 1012 is redundant — passing resolvedTranscriptionLanguage directly yields the same result and keeps the mapping in one place.

♻️ Optional simplification
             transcriptionModel: transcriptionModel,
-            language: isMixedLanguage ? "en" : resolvedTranscriptionLanguage,
+            language: resolvedTranscriptionLanguage,
             prompt: customPrompt
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Sources/AppState.swift` around lines 1012 - 1023, The mixed-language `"en"`
fallback is duplicated in the transcription language setup, since
resolvedTranscriptionLanguage already maps "hinglish" and "gujlish" to "en".
Update the call site in AppState so the transcription request uses
resolvedTranscriptionLanguage directly instead of the isMixedLanguage ternary,
keeping the mapping centralized in resolvedTranscriptionLanguage and avoiding
redundant logic.

996-1015: 🎯 Functional Correctness | 🔵 Trivial

Realtime service lacks custom prompt support entirely

The RealtimeTranscriptionService does not currently support passing a custom system prompt to the backend. Its Configuration struct includes only baseURL, apiKey, model, and language. Because the field does not exist in the implementation, the prompt cannot be forwarded in the current architecture; the realtime path is not a matter of a missed variable assignment but requires adding support for prompts to the RealtimeTranscriptionService implementation (e.g., extending Configuration and updating the WebSocket payload) to match the file-based service.

Until such support is added, the mixed-language prompt is correctly limited to the file-based transcription path. If Hinglish/Gujlish transcription is mandatory for realtime users, the realtime service requires a feature enhancement to accept and forward custom prompts.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Sources/AppState.swift` around lines 996 - 1015, The mixed-language custom
prompt in makeTranscriptionService is only supported by the file-based
TranscriptionService, not the realtime path. Keep the Hinglish/Gujlish prompt
handling limited to this factory for now, and if realtime support is needed,
extend RealtimeTranscriptionService by adding prompt to its Configuration and
forwarding it in the WebSocket payload before wiring it into AppState.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@Sources/AppState.swift`:
- Around line 1012-1023: The mixed-language `"en"` fallback is duplicated in the
transcription language setup, since resolvedTranscriptionLanguage already maps
"hinglish" and "gujlish" to "en". Update the call site in AppState so the
transcription request uses resolvedTranscriptionLanguage directly instead of the
isMixedLanguage ternary, keeping the mapping centralized in
resolvedTranscriptionLanguage and avoiding redundant logic.
- Around line 996-1015: The mixed-language custom prompt in
makeTranscriptionService is only supported by the file-based
TranscriptionService, not the realtime path. Keep the Hinglish/Gujlish prompt
handling limited to this factory for now, and if realtime support is needed,
extend RealtimeTranscriptionService by adding prompt to its Configuration and
forwarding it in the WebSocket payload before wiring it into AppState.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 556d3b58-06a5-4fbd-a3de-6832386d4ff2

📥 Commits

Reviewing files that changed from the base of the PR and between ace7bc3 and 9c87f08.

📒 Files selected for processing (3)
  • Sources/AppState.swift
  • Sources/PostProcessingService.swift
  • Sources/SettingsView.swift
🚧 Files skipped from review as they are similar to previous changes (1)
  • Sources/PostProcessingService.swift

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Sources/PostProcessingService.swift`:
- Around line 630-636: The output-language directive in applyOutputLanguage is
too broad because the native-script prohibition is being applied for every
language; update the prompt construction so the “Do NOT use the native script”
constraint is only appended when the language is Hinglish or Gujlish, while
preserving the existing explanation text and output-only requirement for those
two cases. Keep the logic localized in applyOutputLanguage by branching on the
language value alongside the current explanation handling, so explicit languages
like Hindi or Gujarati can use their native scripts normally.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 334fb666-7fb0-4b45-ae63-3ea638b9cd5e

📥 Commits

Reviewing files that changed from the base of the PR and between ea6eec3 and 4e996eb.

📒 Files selected for processing (1)
  • Sources/PostProcessingService.swift

Comment thread Sources/PostProcessingService.swift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant