Skip to content

Commit 6dbf211

Browse files
Rename getTranscriptionStream to getStream in JS SDK and update E2E test
Co-authored-by: kunal-vaishnavi <115581922+kunal-vaishnavi@users.noreply.github.com>
1 parent 69b7497 commit 6dbf211

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ logs/
3838

3939
# Local NuGet packages built from source
4040
local-packages/
41+
42+
# JS SDK downloaded native core binaries
43+
sdk/js/foundry-local-core/

sdk/js/src/openai/liveAudioSession.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export class LiveAudioTranscriptionSession {
191191

192192
/**
193193
* Start a real-time audio streaming session.
194-
* Must be called before append() or getTranscriptionStream().
194+
* Must be called before append() or getStream().
195195
* Settings are frozen after this call.
196196
*/
197197
public async start(): Promise<void> {
@@ -319,17 +319,17 @@ export class LiveAudioTranscriptionSession {
319319
*
320320
* Usage:
321321
* ```ts
322-
* for await (const result of client.getTranscriptionStream()) {
322+
* for await (const result of client.getStream()) {
323323
* console.log(result.content[0].text);
324324
* }
325325
* ```
326326
*/
327-
public async *getTranscriptionStream(): AsyncGenerator<LiveAudioTranscriptionResponse> {
327+
public async *getStream(): AsyncGenerator<LiveAudioTranscriptionResponse> {
328328
if (!this.outputQueue) {
329329
throw new Error('No active streaming session. Call start() first.');
330330
}
331331
if (this.streamConsumed) {
332-
throw new Error('getTranscriptionStream() can only be called once per session. The output stream has already been consumed.');
332+
throw new Error('getStream() can only be called once per session. The output stream has already been consumed.');
333333
}
334334
this.streamConsumed = true;
335335

@@ -341,7 +341,7 @@ export class LiveAudioTranscriptionSession {
341341
/**
342342
* Signal end-of-audio and stop the streaming session.
343343
* Any remaining buffered audio in the push queue will be drained to native core first.
344-
* Final results are delivered through getTranscriptionStream() before it completes.
344+
* Final results are delivered through getStream() before it completes.
345345
*/
346346
public async stop(): Promise<void> {
347347
if (!this.started || this.stopped) {

sdk/js/test/openai/liveAudioTranscription.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ describe('Live Audio Transcription Types', () => {
160160
// Collect results in background (must start before pushing audio)
161161
const results: any[] = [];
162162
const readPromise = (async () => {
163-
for await (const result of session.getTranscriptionStream()) {
163+
for await (const result of session.getStream()) {
164164
results.push(result);
165165
}
166166
})();

0 commit comments

Comments
 (0)