Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Notes-Audio.docx
Binary file not shown.
6 changes: 3 additions & 3 deletions sdk_v2/cs/src/Microsoft.AI.Foundry.Local.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@
<PropertyGroup>
<!-- default version unless overridden during dotnet build/restore command -->
<FoundryLocalCoreWinMLVersion Condition="'$(FoundryLocalCoreVersion)' != ''">$(FoundryLocalCoreVersion)</FoundryLocalCoreWinMLVersion>
<FoundryLocalCoreWinMLVersion Condition="'$(FoundryLocalCoreVersion)' == ''">0.9.0.8-rc3</FoundryLocalCoreWinMLVersion>
<FoundryLocalCoreVersion Condition="'$(FoundryLocalCoreVersion)' == ''">0.9.0.8-rc3</FoundryLocalCoreVersion> </PropertyGroup>
<FoundryLocalCoreWinMLVersion Condition="'$(FoundryLocalCoreVersion)' == ''">0.9.0-dev-20260227T230631-2a3af92</FoundryLocalCoreWinMLVersion>
<FoundryLocalCoreVersion Condition="'$(FoundryLocalCoreVersion)' == ''">0.9.0-dev-20260227T222239-2a3af92</FoundryLocalCoreVersion> </PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
Expand All @@ -125,4 +125,4 @@
<!-- specify PrivateAssets to exclude from nuget dependencies -->
<PackageReference Include="IDisposableAnalyzers" Version="4.0.8" PrivateAssets="all"/>
</ItemGroup>
</Project>
</Project>
13 changes: 1 addition & 12 deletions sdk_v2/cs/src/OpenAI/ChatClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private async IAsyncEnumerable<ChatCompletionCreateResponse> ChatStreamingImplAs
{
var failed = false;

var response = await _coreInterop.ExecuteCommandWithCallbackAsync(
await _coreInterop.ExecuteCommandWithCallbackAsync(
"chat_completions",
request,
async (callbackData) =>
Expand All @@ -196,17 +196,6 @@ private async IAsyncEnumerable<ChatCompletionCreateResponse> ChatStreamingImplAs
ct
).ConfigureAwait(false);

// If the native layer returned an error (e.g. missing model, invalid input)
// without invoking any callbacks, propagate it so the caller sees an exception
// instead of an empty stream.
if (!failed && response.Error != null)
{
channel.Writer.TryComplete(
new FoundryLocalException($"Error from chat_completions command: {response.Error}", _logger));
failed = true;
return;
}

// use TryComplete as an exception in the callback may have already closed the channel
_ = channel.Writer.TryComplete();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
</None>
</ItemGroup>

<ItemGroup Condition="'$(RuntimeIdentifier)' != 'linux-x64' AND '$(UseWinML)' != 'true'">
<PackageReference Include="Microsoft.ML.OnnxRuntime.Gpu.Linux" Version="1.24.1" ExcludeAssets="all" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
8 changes: 8 additions & 0 deletions sdk_v2/js/src/imodel.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ChatClient } from './openai/chatClient.js';
import { AudioClient } from './openai/audioClient.js';
import { LiveAudioTranscriptionClient } from './openai/liveAudioTranscriptionClient.js';
import { ResponsesClient } from './openai/responsesClient.js';

export interface IModel {
Expand All @@ -16,6 +17,13 @@ export interface IModel {

createChatClient(): ChatClient;
createAudioClient(): AudioClient;

/**
* Creates a LiveAudioTranscriptionClient for real-time audio streaming ASR.
* The model must be loaded before calling this method.
* @returns A LiveAudioTranscriptionClient instance.
*/
createLiveTranscriptionClient(): LiveAudioTranscriptionClient;
/**
* Creates a ResponsesClient for interacting with the model via the Responses API.
* Unlike createChatClient/createAudioClient (which use FFI), the Responses API
Expand Down
2 changes: 2 additions & 0 deletions sdk_v2/js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export { ModelVariant } from './modelVariant.js';
export type { IModel } from './imodel.js';
export { ChatClient, ChatClientSettings } from './openai/chatClient.js';
export { AudioClient, AudioClientSettings } from './openai/audioClient.js';
export { LiveAudioTranscriptionClient, LiveAudioTranscriptionSettings } from './openai/liveAudioTranscriptionClient.js';
export type { LiveAudioTranscriptionResult, CoreErrorResponse } from './openai/liveAudioTranscriptionTypes.js';
export { ResponsesClient, ResponsesClientSettings, getOutputText } from './openai/responsesClient.js';
export { ModelLoadManager } from './detail/modelLoadManager.js';
/** @internal */
Expand Down
9 changes: 9 additions & 0 deletions sdk_v2/js/src/model.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ModelVariant } from './modelVariant.js';
import { ChatClient } from './openai/chatClient.js';
import { AudioClient } from './openai/audioClient.js';
import { LiveAudioTranscriptionClient } from './openai/liveAudioTranscriptionClient.js';
import { ResponsesClient } from './openai/responsesClient.js';
import { IModel } from './imodel.js';

Expand Down Expand Up @@ -148,6 +149,14 @@ export class Model implements IModel {
return this.selectedVariant.createAudioClient();
}

/**
* Creates a LiveAudioTranscriptionClient for real-time audio streaming ASR.
* @returns A LiveAudioTranscriptionClient instance.
*/
public createLiveTranscriptionClient(): LiveAudioTranscriptionClient {
return this.selectedVariant.createLiveTranscriptionClient();
}

/**
* Creates a ResponsesClient for interacting with the model via the Responses API.
* @param baseUrl - The base URL of the Foundry Local web service.
Expand Down
9 changes: 9 additions & 0 deletions sdk_v2/js/src/modelVariant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ModelLoadManager } from './detail/modelLoadManager.js';
import { ModelInfo } from './types.js';
import { ChatClient } from './openai/chatClient.js';
import { AudioClient } from './openai/audioClient.js';
import { LiveAudioTranscriptionClient } from './openai/liveAudioTranscriptionClient.js';
import { ResponsesClient } from './openai/responsesClient.js';
import { IModel } from './imodel.js';

Expand Down Expand Up @@ -129,6 +130,14 @@ export class ModelVariant implements IModel {
return new AudioClient(this._modelInfo.id, this.coreInterop);
}

/**
* Creates a LiveAudioTranscriptionClient for real-time audio streaming ASR.
* @returns A LiveAudioTranscriptionClient instance.
*/
public createLiveTranscriptionClient(): LiveAudioTranscriptionClient {
return new LiveAudioTranscriptionClient(this._modelInfo.id, this.coreInterop);
}

/**
* Creates a ResponsesClient for interacting with the model via the Responses API.
* @param baseUrl - The base URL of the Foundry Local web service.
Expand Down
Loading
Loading