Skip to content

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

Open
egenthon-cmd wants to merge 2 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 2 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 transcription docs with clearer guidance on language selection, code switching, and supported model behavior.
    • Added an example showing --model solaria-3 with an explicit --language flag.
  • Bug Fixes

    • Improved CLI validation for language input, including clearer errors for space-separated values.
    • Enforced model-specific transcription rules so solaria-3 only accepts one language and does not support code switching.
    • Updated transcription requests to avoid sending empty optional fields and to use the latest pre-recorded transcription endpoint.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The transcribe CLI now validates normalized model and language inputs, updates its help text and README examples, and posts audio URLs to /v2/pre-recorded with omitted empty optional request fields. Tests were updated for the new endpoint, request shape, and solaria-3 language rules.

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.

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

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • gladiaio/gladia-cli#24: Updates the same transcription client flow in pkg/client/transcribe.go, including GladiaClient.TranscribeAudioURL.

Suggested reviewers

  • nmorel

Poem

A rabbit hopped through flags of green,
To /v2/pre-recorded, neat and clean.
One language hush, one clover bite,
Then --cs danced in moonlit light.
Thump—transcripts sparkled bright.

🚥 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: fixing the Solaria 3 endpoint and behavior to align with the OpenAPI spec.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 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
cmd.Flags().BoolVarP(&verbose, "verbose", "v", false, "Show progress while transcribing")
cmd.Flags().BoolVar(&diarization, "diarize", false, "Enable speaker diarization")
cmd.Flags().StringVar(&modelFlag, "model", "", "STT model: solaria-1 or solaria-3 (default: API default)")
cmd.Flags().StringVar(&modelFlag, "model", "", "STT model: solaria-1 or solaria-3 (solaria-3 accepts at most one --language: en, fr, de, es, or it)")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not at most, it accepts only one

Comment thread README.md
| `--language` | — | Expected language(s), comma-separated (`en` or `en,fr,de`) |
| `--code-switching`, `--code-switch` | off | Detect language per utterance |
| `--language` | — | Expected language(s), comma-separated (`en` or `en,fr,de`); narrows detection, does not enable code switching |
| `--cs`, `--code-switching` | off | Re-detect language on each utterance (mixed-language audio; solaria-1 only) |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think it's should be -cs instead, wdyt?

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