Skip to content

fix: solaria 3 correct endpoint and matching behavior with the openapi#27

Open
egenthon-cmd wants to merge 7 commits into
mainfrom
fix/correct-endpoint-model
Open

fix: solaria 3 correct endpoint and matching behavior with the openapi#27
egenthon-cmd wants to merge 7 commits into
mainfrom
fix/correct-endpoint-model

Conversation

@egenthon-cmd

@egenthon-cmd egenthon-cmd commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Fix for the correct endpoint. That is why Solaria 3 was throwing an error.
Add --cs for code switching as short command
Also, the solaria 3 does not throw an error when no language is detected

Summary by CodeRabbit

  • Documentation
    • Updated gladia transcribe docs with clearer guidance on --language, --cs/--code-switching, and model-specific behavior—specifically that solaria-3 supports only one language and no code switching.
    • Added a --model solaria-3 example with an explicit --language.
  • Bug Fixes
    • Improved CLI validation for language inputs, including clearer errors for space-separated values.
    • Enforced model-specific rules for solaria-3 (single language only; code switching disallowed).
  • Bug Fixes
    • Updated transcription requests to use the current pre-recorded submission endpoint and omit empty optional fields from the request payload.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@egenthon-cmd, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 35 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 70ed3552-0f4b-4d76-9a52-2ee5e2c0a3db

📥 Commits

Reviewing files that changed from the base of the PR and between 2fe2d16 and c8f6aaf.

📒 Files selected for processing (1)
  • cmd/transcribe.go
📝 Walkthrough

Walkthrough

The transcribe CLI now validates normalized language and model inputs, updates its help text and README examples, and posts audio URLs to /v2/pre-recorded with omitted empty optional request fields. Language display helpers now normalize selected Gladia codes before printing names.

Changes

Transcribe CLI and client contract update

Layer / File(s) Summary
Help text and README
cmd/transcribe.go, README.md
The transcribe examples and flag wording now describe --language, --cs/--code-switching, --diarize, and solaria-3 together.
Language and model validation
cmd/transcribe.go, cmd/transcribe_test.go
RunE parses --language, normalizes the model, validates solaria-3 language and code-switching combinations, and tests those rules.
Request payload and endpoint
pkg/client/transcribe.go, pkg/client/client_test.go, pkg/client/transcribe_test.go, cmd/transcribe_test.go
The client omits empty optional fields, posts to /v2/pre-recorded, and the CLI/client tests expect the new request shape.

Language display helpers

Layer / File(s) Summary
Language display helpers and CLI output
pkg/client/types/languages.go, pkg/client/types/languages_test.go, cmd/root_test.go
Language listing now uses shared display-name mapping helpers, and the language command test checks representative output entries.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RunE
  participant GladiaClient.TranscribeAudioURL
  participant createAndExecuteRequest
  participant Gladia API

  RunE->>GladiaClient.TranscribeAudioURL: normalized model and language config
  GladiaClient.TranscribeAudioURL->>createAndExecuteRequest: POST /v2/pre-recorded with JSON body
  createAndExecuteRequest->>Gladia API: send transcription request
  Gladia API-->>createAndExecuteRequest: transcription response
  createAndExecuteRequest-->>GladiaClient.TranscribeAudioURL: decoded result
Loading

Possibly related PRs

  • gladiaio/gladia-cli#24: Updates the same transcription client flow in pkg/client/transcribe.go, including GladiaClient.TranscribeAudioURL.
  • gladiaio/gladia-cli#26: Modifies the transcribe CLI and request construction around languages, model handling, and code-switching.

Suggested reviewers: jqueguiner, nmorel, karamouche

🚥 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 is relevant to the main change set, calling out the Solaria 3 endpoint fix and OpenAPI-aligned behavior.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/correct-endpoint-model

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.

🧹 Nitpick comments (2)
cmd/transcribe_test.go (1)

375-419: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add one case that exercises --cs directly.

This PR introduces --cs, but the request-body coverage here still only proves --code-switching. A small table-driven variant over both flag names would pin the new alias wiring too.

🤖 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 `@cmd/transcribe_test.go` around lines 375 - 419, The transcribe command test
only covers the long-form code-switching flag, so it does not verify the new
`--cs` alias wiring. Update
`TestTranscribeCommand_codeSwitchingWithoutLanguages` to exercise both flag
names, ideally with a small table-driven subtest over `--code-switching` and
`--cs`, and assert the same `language_config` payload from the `newRootCmd`
execution.
pkg/client/transcribe.go (1)

46-50: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a marshal-level test for these new omitempty fields.

This change alters the wire contract for zero-valued summarization, translation, and custom vocabulary fields, but the updated suite only asserts omission for model/language/diarization paths. A small JSON serialization test would keep this behavior from regressing silently.

🤖 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 `@pkg/client/transcribe.go` around lines 46 - 50, Add a marshal-level test in
the transcribe client serialization tests to verify the new omitempty behavior
for Summarization, Translation, and CustomVocabulary in the Transcribe request
struct. Update or extend the existing JSON serialization coverage around the
Transcribe type so that zero-valued Summarization, Translation,
SummarizationConfig, TranslationConfig, and CustomVocabulary are omitted from
the payload, similar to the existing model/language/diarization assertions.
🤖 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 `@cmd/transcribe_test.go`:
- Around line 375-419: The transcribe command test only covers the long-form
code-switching flag, so it does not verify the new `--cs` alias wiring. Update
`TestTranscribeCommand_codeSwitchingWithoutLanguages` to exercise both flag
names, ideally with a small table-driven subtest over `--code-switching` and
`--cs`, and assert the same `language_config` payload from the `newRootCmd`
execution.

In `@pkg/client/transcribe.go`:
- Around line 46-50: Add a marshal-level test in the transcribe client
serialization tests to verify the new omitempty behavior for Summarization,
Translation, and CustomVocabulary in the Transcribe request struct. Update or
extend the existing JSON serialization coverage around the Transcribe type so
that zero-valued Summarization, Translation, SummarizationConfig,
TranslationConfig, and CustomVocabulary are omitted from the payload, similar to
the existing model/language/diarization assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c09ca660-d062-465a-98f4-284c13d5ee40

📥 Commits

Reviewing files that changed from the base of the PR and between 6eb7ef1 and 8e8c9ce.

📒 Files selected for processing (6)
  • README.md
  • cmd/transcribe.go
  • cmd/transcribe_test.go
  • pkg/client/client_test.go
  • pkg/client/transcribe.go
  • pkg/client/transcribe_test.go

@egenthon-cmd egenthon-cmd requested a review from karamouche June 26, 2026 15:34
Comment thread cmd/transcribe.go
Comment thread README.md
Co-authored-by: Cursor <cursoragent@cursor.com>

@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 (1)
pkg/client/types/languages.go (1)

298-316: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicated enumeration risks drift with allInputLanguages().

allTargetLanguages() re-lists the exact same set of codes as allInputLanguages() (lines 278-296), just retyped. If a language is added/removed from one list but not the other, the two enumerations will silently diverge.

Since TargetLanguage and Language appear to share identical underlying string values, consider deriving one from the other:

♻️ Suggested refactor
 func allTargetLanguages() []TargetLanguage {
-	return []TargetLanguage{
-		TargetLanguageAf, TargetLanguageSq, TargetLanguageAm, TargetLanguageAr, TargetLanguageHy, TargetLanguageAs, TargetLanguageAz,
-		...
-		TargetLanguageYo,
-	}
+	langs := allInputLanguages()
+	targets := make([]TargetLanguage, len(langs))
+	for i, l := range langs {
+		targets[i] = TargetLanguage(l)
+	}
+	return targets
 }

This assumes the Language/TargetLanguage constant values are string-identical pairs — please confirm before applying.

🤖 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 `@pkg/client/types/languages.go` around lines 298 - 316, allTargetLanguages
duplicates the same language set as allInputLanguages, which can drift over
time. Refactor allTargetLanguages to derive its slice from the Language list or
a shared helper in pkg/client/types/languages.go, reusing the existing constants
so both enumerations stay identical. Confirm the underlying string values match
for Language and TargetLanguage before wiring the shared source through
allInputLanguages and allTargetLanguages.
🤖 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 `@pkg/client/types/languages.go`:
- Around line 298-316: allTargetLanguages duplicates the same language set as
allInputLanguages, which can drift over time. Refactor allTargetLanguages to
derive its slice from the Language list or a shared helper in
pkg/client/types/languages.go, reusing the existing constants so both
enumerations stay identical. Confirm the underlying string values match for
Language and TargetLanguage before wiring the shared source through
allInputLanguages and allTargetLanguages.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 44215821-872b-458e-bc88-eddd83621585

📥 Commits

Reviewing files that changed from the base of the PR and between 8e8c9ce and 2fe2d16.

📒 Files selected for processing (6)
  • cmd/root_test.go
  • cmd/transcribe_test.go
  • pkg/client/transcribe.go
  • pkg/client/transcribe_test.go
  • pkg/client/types/languages.go
  • pkg/client/types/languages_test.go
✅ Files skipped from review due to trivial changes (1)
  • pkg/client/types/languages_test.go
🚧 Files skipped from review as they are similar to previous changes (3)
  • pkg/client/transcribe_test.go
  • pkg/client/transcribe.go
  • cmd/transcribe_test.go

@egenthon-cmd egenthon-cmd dismissed karamouche’s stale review July 2, 2026 19:49

Changes taken into account and fixed

@egenthon-cmd egenthon-cmd requested a review from karamouche July 2, 2026 19:50
karamouche
karamouche previously approved these changes Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants