stt: fix API-ref response examples to match real API (DS-591 follow-up) - #360
Open
abhishekmishragithub wants to merge 1 commit into
Open
stt: fix API-ref response examples to match real API (DS-591 follow-up)#360abhishekmishragithub wants to merge 1 commit into
abhishekmishragithub wants to merge 1 commit into
Conversation
Follow-up to the merged PR #355 which clarified the word_timestamps gate but left the schema itself drifted from what the live API returns. DS-591 Postman screenshots showed the mismatch. Corrected on both stt-openapi.yaml (/waves/v1/stt/) and pulse-stt-openapi.yaml (/waves/v1/pulse/get_text): Field-type fixes: - speaker: type: string, example: speaker_0 -> type: integer, example: 0 (zero-indexed label) - New speaker_confidence field on word entries (float 0.0-1.0, present alongside speaker on Pulse with diarize=true). Pulse vs Pulse Pro separation on the unified endpoint: - Pulse response is {status, transcription, words[], utterances[], metadata: {duration, fileSize}}. No language, no request_id, no processing_time_ms, rtfx, num_chunks (those are Pulse Pro). - Pulse Pro adds language, request_id, totalBytes at top level and processing_time_ms + rtfx + num_chunks inside metadata. Pro does not diarize, so words[] entries omit speaker/speaker_confidence and utterances[] is absent entirely. Description fixes: - Legacy Pulse endpoint's metadata.duration said "in minutes"; it is seconds. Corrected. Response examples split by scenario. The unified endpoint uses named examples: (pulse-default, pulse-full, pulse-pro) so the docs explorer surface distinct real payloads instead of one mixed sample. The legacy endpoint uses named examples for default vs word_timestamps+diarize. Live-verified on api.smallest.ai with a WAV generated via TTS. Every scenario in the new examples matches the live payload on the field-shape axis (values differ per request, obviously).
|
🌿 Preview your docs: https://smallest-ai-preview-fix-waves-api-ref-response-shape-audit.docs.buildwithfern.com Here are the markdown pages you've updated: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to the merged PR #355. That PR clarified the
word_timestampsgate in the description; this one aligns the schema itself with what the API actually returns. The Postman screenshot on DS-591 surfaced the drift.What was wrong
The old schema mixed Pulse and Pulse Pro fields into a single example and used a string for
speaker. Real payloads (live-verified onapi.smallest.ai):Pulse (
/waves/v1/stt/?model=pulseand legacy/waves/v1/pulse/get_text):{ "status": "success", "transcription": "...", "words": [ { "start": 0.16, "end": 1.12, "speaker": 0, "speaker_confidence": 1, "word": "Hello,", "confidence": 0.9975 } ], "utterances": [ { "start": 0.16, "end": 2.88, "speaker": 0, "text": "..." } ], "metadata": { "duration": 5.28, "fileSize": 465740 } }No
language, norequest_id, noprocessing_time_ms/rtfx/num_chunks.speakeris an integer, not"speaker_0". Word entries carryspeaker_confidencealongsidespeaker.Pulse Pro (
/waves/v1/stt/?model=pulse-pro):{ "status": "success", "transcription": "...", "words": [ { "word": "Hello.", "start": 0.24, "end": 1.2, "confidence": 0.9626 } ], "language": "en", "metadata": { "duration": 5.28, "processing_time_ms": 172.11, "rtfx": 30.7, "num_chunks": 1 }, "totalBytes": 465740, "request_id": "36e977cf-..." }Pro does not diarize, so
words[]entries omitspeakerandspeaker_confidence, and there is noutterances[]field.Fixes in this PR
Word.speakertypestring→integer, examplespeaker_0→0.Word.speaker_confidenceadded (float, 0.0–1.0, present alongsidespeakeron Pulse+diarize).Utterance.speakertypestring→integer, same fix.TranscriptionResponse.metadata:durationstays on both;fileSizemarked Pulse-only;processing_time_ms+rtfx+num_chunksmarked Pulse-Pro-only. All example values match live.TranscriptionResponse.languageand.request_iddescriptions clarify they only appear on Pulse Pro.totalBytesadded at top level (Pulse Pro only).examples:so the docs explorer shows distinct real payloads forpulse-default,pulse-full(word_timestamps + diarize), andpulse-pro./waves/v1/pulse/get_text: same field-shape fixes, plus corrected themetadata.durationdescription from "in minutes" to seconds, and split the example intodefaultandwith-word-timestamps-and-diarize.Audit coverage note
The user's ask was a broader "validate all example responses across API-ref pages". Scope for this PR:
GET /waves/v1/lightning-v3.1/get_voices) — live-checked, schema matches real API ({voices: [{voiceId, displayName, tags: {language, accent, gender, age, emotions, usecases}}]}). No change needed.modelIds[]in real response, spec doesn't mention; Electron returns extra vLLM fields likerefusal,annotations,audio,function_call,reasoning,stop_reason,token_ids,routed_experts,service_tier,system_fingerprint). Deferred to a follow-up PR to keep this one scoped to the reported bug + its direct STT neighbours.Test plan
fern checkcleanapi.smallest.aifor four scenarios (Pulse default, Pulse word_timestamps+diarize, Pulse Pro, webhook async): every documented field matches actual payload keys and types/models/api-reference/api-reference/speech-to-text/transcribe(or the v4 path if that's what's live)