Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…and SDK examples - Update README.md to prominently feature audio transcription (STT) alongside chat completions, including a Supported Tasks table, JS code examples for audio transcription and unified chat+audio, and updated Features section - Add samples/js/audio-transcription-foundry-local: standalone Whisper STT sample - Add samples/js/chat-and-audio-foundry-local: unified chat + audio sample demonstrating single FoundryLocalManager managing both model types - Add sdk_v2/js/examples/audio-transcription.ts: TypeScript audio example - Update docs/README.md with capabilities table and sample links Addresses the discoverability gap where LLMs and developers do not know Foundry Local supports audio transcription via Whisper models.
5c043bb to
16f4488
Compare
There was a problem hiding this comment.
Pull request overview
This PR expands the Foundry Local JavaScript developer experience by adding a new audio transcription (Whisper) sample and updating top-level documentation to show unified chat + audio usage via the JS SDK.
Changes:
- Added a JS sample app demonstrating Whisper model download/load and transcription.
- Added sample-scoped documentation and npm manifest for running the new sample.
- Updated the root README with richer JS examples for chat, audio transcription, and combined workflows.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| samples/js/audio-transcription-foundry-local/src/app.js | New sample implementation for standard + streaming audio transcription. |
| samples/js/audio-transcription-foundry-local/package.json | Adds a runnable npm package manifest for the sample. |
| samples/js/audio-transcription-foundry-local/README.md | Adds setup/run instructions and explains what the sample demonstrates. |
| README.md | Updates documentation examples for chat, audio transcription, and combined usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Install the Foundry Local SDK: | ||
|
|
||
| ```bash | ||
| npm install foundry-local-sdk |
There was a problem hiding this comment.
This sample has a package.json with foundry-local-sdk already listed as a dependency, but the README instructs npm install foundry-local-sdk. That can leave users without the locked dependency tree for the sample; prefer npm install (then npm start / node src/app.js) from the sample directory.
| Install the Foundry Local SDK: | |
| ```bash | |
| npm install foundry-local-sdk | |
| From this sample's directory, install dependencies: | |
| ```bash | |
| npm install |
| await audioClient.transcribeStreaming(audioFilePath, (chunk) => { | ||
| process.stdout.write(chunk.text); | ||
| }); |
There was a problem hiding this comment.
AudioClient.transcribeStreaming in the JS SDK returns an AsyncIterable and does not take a callback parameter. Calling it as await audioClient.transcribeStreaming(audioFilePath, (chunk) => ...) will throw/compile-fail; update the sample to iterate the returned stream (e.g., with for await ... of) and write each chunk.
| await audioClient.transcribeStreaming(audioFilePath, (chunk) => { | |
| process.stdout.write(chunk.text); | |
| }); | |
| const stream = await audioClient.transcribeStreaming(audioFilePath); | |
| for await (const chunk of stream) { | |
| process.stdout.write(chunk.text); | |
| } |
| "start": "node src/app.js" | ||
| }, | ||
| "dependencies": { | ||
| "foundry-local-sdk": "latest" |
There was a problem hiding this comment.
Using the "latest" npm dist-tag makes this sample non-reproducible and can break unexpectedly when a new major version is published. Prefer a semver range (e.g. ^<current version>) or a workspace/file reference so the sample remains stable over time.
| "foundry-local-sdk": "latest" | |
| "foundry-local-sdk": "^1.0.0" |
This pull request introduces comprehensive support for audio transcription (speech-to-text) using Whisper models in the Foundry Local SDK, alongside unified chat and audio capabilities. It adds new documentation, sample apps, and code examples demonstrating how to use both chat and audio features through a single SDK, highlighting automatic hardware acceleration and simplified integration. The updates make it easier for developers to build applications that combine text generation and speech-to-text without needing separate runtimes or hardware detection code.
Documentation and SDK feature updates:
README.mdanddocs/README.mdto clarify that Foundry Local now supports both chat (text generation) and audio transcription (speech-to-text) in a single runtime, with automatic hardware acceleration and unified APIs. Added tables listing supported tasks, model aliases, and API usage. [1] [2]New sample applications and examples:
samples/js/audio-transcription-foundry-localsample, including a detailed README,package.json, and implementation insrc/app.js, showing how to load Whisper models and transcribe audio files (standard and streaming modes). [1] [2] [3]samples/js/chat-and-audio-foundry-localsample, with README,package.json, and implementation insrc/app.js, demonstrating unified management of chat and audio models, transcribing audio, and analyzing the transcription with a chat model. [1] [2] [3]SDK example enhancements:
audio-transcription.tsinsdk_v2/js/examples, showcasing programmatic use of Whisper models for audio transcription, including model discovery, download, loading, and both standard and streaming transcription.responses.tsexample tosdk_v2/js/examples, demonstrating the Responses API for text generation, streaming, multi-turn conversations, tool calling, and response management.