feat(misc): voice-chat-widget-with-vercel-sdk + ITN "and" gotcha#54
Closed
abhishekmishragithub wants to merge 4 commits into
Closed
feat(misc): voice-chat-widget-with-vercel-sdk + ITN "and" gotcha#54abhishekmishragithub wants to merge 4 commits into
abhishekmishragithub wants to merge 4 commits into
Conversation
End-to-end Next.js example combining all three Smallest products in parallel: Pulse STT (live transcription with ITN), Electron LLM (OpenAI- compatible chat-completions streaming), and Lightning v3.1 TTS (streaming audio over WebSocket). One SMALLEST_API_KEY powers everything. The README is a deep-dive on the agentic ITN config — finalize_on_words, eou_timeout_ms, close_stream — that customers most commonly get wrong, with worked examples (currency, phone numbers, dates, emails, decimals).
…Vercel AI provider Sibling folder to voice-chat-widget/ but swaps the STT and LLM legs to the SDK (smallestai-vercel-provider + Vercel ai). STT goes browser-direct via auth: 'query' so no STT proxy is needed; LLM uses streamText with @ai-sdk/openai-compatible pointed at Electron. TTS still uses raw WS via a slimmer proxy.mjs since the SDK does not yet wrap streaming TTS. The README is the diff vs the raw-WS sibling — same ITN config translated from snake_case strings to SDK camelCase booleans, same param mapping table, and a production handoff note about auth: 'query' → signedUrl.
Adds trap #8 to the raw-WS README and a cross-reference in the SDK README. 'five hundred and twenty five dollars' normalizes to '500 and 25 dollars', not '$525', because Pulse's WFST treats 'and' as a word boundary that breaks up multi-token cardinal entities. Documents the workaround (drop the 'and') and a post-process regex for when you can't control phrasing.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
Author
|
Closing — conflicting with main because the raw-WS commits were already squash-merged in #53. Reopening as a clean follow-up branched directly off main. |
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 #53. That PR was squash-merged before these later commits landed, so the SDK twin folder and the README update didn't make it to main.
This PR adds:
misc/voice-chat-widget-with-vercel-sdk/— sibling to the raw-WS folder shipped in feat(misc): voice-chat-widget — raw-WS + Vercel SDK versions #53, same UX but usessmallestai-vercel-provider+ai+@ai-sdk/openai-compatible. STT goes browser-direct viaauth: 'query'(no STT proxy); LLM usesstreamText; streaming TTS still raw-WS since the SDK does not yet wrap/waves/v1/tts/live. README includes the snake_case → camelCase param mapping table and theauth: 'query'→signedUrlproduction handoff note.misc/voice-chat-widget/README.md— appended ITN gotcha Add blog code sample #8: spoken "and" inside dollar amounts breaks the currency entity ("five hundred and twenty five dollars" → "500 and 25 dollars", not "$525"). Includes the WFST-boundary explanation, two workaround phrasings, and a regex fallback for non-controllable UX..gitignorein both folders — adds*.tsbuildinfoso TS incremental cache never gets committed.Test plan
cd misc/voice-chat-widget-with-vercel-sdk && cp .env.example .env.local && npm install && npm run devboots cleanlyitn_normalize=true,finalize_on_words=false,eou_timeout_ms=1000auth: 'query'security warning in proxy logs — by design