Skip to content

feat: add diarize_model option to pre-recorded transcription#412

Merged
GregHolmes merged 2 commits into
mainfrom
feat/diarize-model-v2
Jun 8, 2026
Merged

feat: add diarize_model option to pre-recorded transcription#412
GregHolmes merged 2 commits into
mainfrom
feat/diarize-model-v2

Conversation

@GregHolmes

Copy link
Copy Markdown
Collaborator

What changed

  • Added string? DiarizeModel to the canonical PreRecordedSchema (Deepgram/Models/Listen/v1/REST/PreRecordedSchema.cs), with [JsonPropertyName("diarize_model")] + [JsonIgnore(WhenWritingNull)], so it serializes to the diarize_model query param on POST /v1/listen. Accepts latest / v1 / v2 (typed as string to mirror existing model/diarize_version properties and stay forward-compatible). The deprecated PreRecorded.v1.PreRecordedSchema subclass inherits it automatically.
  • Added unit tests asserting diarize_model=v2 appears in the outgoing query string and is omitted when unset. dotnet build 0 errors; full unit suite 165/165 on .NET 8.

Why

The playground needs to surface Diarization v2, and .NET is a playground-supported SDK whose spec-driven regen isn't ready yet. This hand-written change bridges the gap; the regenerated SDK will pick up diarize_model natively later.

Non-breaking

Additive only. The deprecated diarize boolean is untouched and the property is omitted when null. Batch-only: intentionally not added to the streaming LiveSchema, since the API rejects diarize_model on streaming requests.

Add `DiarizeModel` as a typed, optional string property on the canonical
PreRecordedSchema (Deepgram.Models.Listen.v1.REST), serialized to the
`diarize_model` query param on POST /v1/listen via [JsonPropertyName].
Accepts the API spec's values (latest, v1, v2), surfacing Batch
Diarization v2 to callers.

Mirrors the existing `diarize`/`diarize_version`/`model` property pattern
(JsonPropertyName + JsonIgnore WhenWritingNull). The deprecated
PreRecorded.v1.PreRecordedSchema subclass inherits it automatically.
Additive and non-breaking; the deprecated `diarize` boolean is left
intact. Batch-only: not added to the streaming LiveSchema, matching the
API constraint that diarize_model is rejected on streaming requests.

Adds unit tests asserting diarize_model=v2 appears in the outgoing batch
request query string, and is omitted when unset.
@GregHolmes GregHolmes self-assigned this Jun 5, 2026
Comment thread Deepgram/Models/Listen/v1/REST/PreRecordedSchema.cs
@GregHolmes GregHolmes merged commit 4c9ac9e into main Jun 8, 2026
2 checks passed
@GregHolmes GregHolmes deleted the feat/diarize-model-v2 branch June 8, 2026 08:46
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