diff --git a/.github/workflows/samples-integration-test.yml b/.github/workflows/samples-integration-test.yml index c844ca12..412942c1 100644 --- a/.github/workflows/samples-integration-test.yml +++ b/.github/workflows/samples-integration-test.yml @@ -171,7 +171,7 @@ jobs: # Note: /p:TreatWarningsAsErrors=false avoids failing on SDK doc warnings dotnet pack sdk/cs/src/Microsoft.AI.Foundry.Local.csproj ` -o local-packages ` - /p:Version=0.9.0-dev ` + /p:Version=1.0.0 ` /p:IsPacking=true ` /p:TreatWarningsAsErrors=false ` --configuration Release @@ -180,7 +180,7 @@ jobs: if ($IsWindows) { dotnet pack sdk/cs/src/Microsoft.AI.Foundry.Local.csproj ` -o local-packages ` - /p:Version=0.9.0-dev-20260324 ` + /p:Version=1.0.0 ` /p:UseWinML=true ` /p:IsPacking=true ` /p:TreatWarningsAsErrors=false ` diff --git a/samples/cs/Directory.Packages.props b/samples/cs/Directory.Packages.props index 6f7b9eef..f4311408 100644 --- a/samples/cs/Directory.Packages.props +++ b/samples/cs/Directory.Packages.props @@ -5,9 +5,9 @@ 1.23.2 - - - + + + diff --git a/samples/cs/live-audio-transcription-example/LiveAudioTranscriptionExample.csproj b/samples/cs/live-audio-transcription-example/LiveAudioTranscriptionExample.csproj deleted file mode 100644 index 3d91b677..00000000 --- a/samples/cs/live-audio-transcription-example/LiveAudioTranscriptionExample.csproj +++ /dev/null @@ -1,55 +0,0 @@ - - - - Exe - enable - enable - - - - - net9.0-windows10.0.26100 - false - ARM64;x64 - None - false - - - - - net9.0 - - - - $(NETCoreSdkRuntimeIdentifier) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/cs/live-audio-transcription-example/LiveAudioTranscriptionExample.sln b/samples/cs/live-audio-transcription-example/LiveAudioTranscriptionExample.sln deleted file mode 100644 index 65ba7510..00000000 --- a/samples/cs/live-audio-transcription-example/LiveAudioTranscriptionExample.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31903.59 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LiveAudioTranscriptionExample", "LiveAudioTranscriptionExample.csproj", "{A2B3C4D5-E6F7-4A8B-9C0D-1E2F3A4B5C6D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A2B3C4D5-E6F7-4A8B-9C0D-1E2F3A4B5C6D}.Debug|Any CPU.ActiveCfg = Debug|ARM64 - {A2B3C4D5-E6F7-4A8B-9C0D-1E2F3A4B5C6D}.Debug|Any CPU.Build.0 = Debug|ARM64 - {A2B3C4D5-E6F7-4A8B-9C0D-1E2F3A4B5C6D}.Debug|x64.ActiveCfg = Debug|x64 - {A2B3C4D5-E6F7-4A8B-9C0D-1E2F3A4B5C6D}.Debug|x64.Build.0 = Debug|x64 - {A2B3C4D5-E6F7-4A8B-9C0D-1E2F3A4B5C6D}.Debug|x86.ActiveCfg = Debug|ARM64 - {A2B3C4D5-E6F7-4A8B-9C0D-1E2F3A4B5C6D}.Debug|x86.Build.0 = Debug|ARM64 - {A2B3C4D5-E6F7-4A8B-9C0D-1E2F3A4B5C6D}.Release|Any CPU.ActiveCfg = Release|ARM64 - {A2B3C4D5-E6F7-4A8B-9C0D-1E2F3A4B5C6D}.Release|Any CPU.Build.0 = Release|ARM64 - {A2B3C4D5-E6F7-4A8B-9C0D-1E2F3A4B5C6D}.Release|x64.ActiveCfg = Release|x64 - {A2B3C4D5-E6F7-4A8B-9C0D-1E2F3A4B5C6D}.Release|x64.Build.0 = Release|x64 - {A2B3C4D5-E6F7-4A8B-9C0D-1E2F3A4B5C6D}.Release|x86.ActiveCfg = Release|ARM64 - {A2B3C4D5-E6F7-4A8B-9C0D-1E2F3A4B5C6D}.Release|x86.Build.0 = Release|ARM64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/samples/cs/live-audio-transcription-example/Program.cs b/samples/cs/live-audio-transcription-example/Program.cs deleted file mode 100644 index 9b4e5921..00000000 --- a/samples/cs/live-audio-transcription-example/Program.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Live Audio Transcription — Foundry Local SDK Example -// -// Demonstrates real-time microphone-to-text using: -// SDK (FoundryLocalManager) → Core (NativeAOT DLL) → onnxruntime-genai (StreamingProcessor) - -using Microsoft.AI.Foundry.Local; -using NAudio.Wave; - -Console.WriteLine("==========================================================="); -Console.WriteLine(" Foundry Local -- Live Audio Transcription Demo"); -Console.WriteLine("==========================================================="); -Console.WriteLine(); - -var config = new Configuration -{ - AppName = "foundry_local_samples", - LogLevel = Microsoft.AI.Foundry.Local.LogLevel.Information -}; - -await FoundryLocalManager.CreateAsync(config, Utils.GetAppLogger()); -var mgr = FoundryLocalManager.Instance; - -await mgr.DownloadAndRegisterEpsAsync(); - -var catalog = await mgr.GetCatalogAsync(); - -var model = await catalog.GetModelAsync("nemotron") ?? throw new Exception("Model \"nemotron\" not found in catalog"); - -await model.DownloadAsync(progress => -{ - Console.Write($"\rDownloading model: {progress:F2}%"); - if (progress >= 100f) - { - Console.WriteLine(); - } -}); - -Console.Write($"Loading model {model.Id}..."); -await model.LoadAsync(); -Console.WriteLine("done."); - -var audioClient = await model.GetAudioClientAsync(); -var session = audioClient.CreateLiveTranscriptionSession(); -session.Settings.SampleRate = 16000; // Default is 16000; shown here to match the NAudio WaveFormat below -session.Settings.Channels = 1; -session.Settings.Language = "en"; - -await session.StartAsync(); -Console.WriteLine(" Session started"); - -var readTask = Task.Run(async () => -{ - try - { - await foreach (var result in session.GetTranscriptionStream()) - { - var text = result.Content?[0]?.Text; - if (result.IsFinal) - { - Console.WriteLine(); - Console.WriteLine($" [FINAL] {text}"); - Console.Out.Flush(); - } - else if (!string.IsNullOrEmpty(text)) - { - Console.ForegroundColor = ConsoleColor.Cyan; - Console.Write(text); - Console.ResetColor(); - Console.Out.Flush(); - } - } - } - catch (OperationCanceledException) { } -}); - -using var waveIn = new WaveInEvent -{ - WaveFormat = new WaveFormat(rate: 16000, bits: 16, channels: 1), - BufferMilliseconds = 100 -}; - -waveIn.DataAvailable += (sender, e) => -{ - if (e.BytesRecorded > 0) - { - _ = session.AppendAsync(new ReadOnlyMemory(e.Buffer, 0, e.BytesRecorded)); - } -}; - -Console.WriteLine(); -Console.WriteLine("==========================================================="); -Console.WriteLine(" LIVE TRANSCRIPTION ACTIVE"); -Console.WriteLine(" Speak into your microphone."); -Console.WriteLine(" Transcription appears in real-time (cyan text)."); -Console.WriteLine(" Press ENTER to stop recording."); -Console.WriteLine("==========================================================="); -Console.WriteLine(); - -waveIn.StartRecording(); -Console.ReadLine(); -waveIn.StopRecording(); - -await session.StopAsync(); -await readTask; - -await model.UnloadAsync(); diff --git a/samples/cs/tutorial-tool-calling/Program.cs b/samples/cs/tutorial-tool-calling/Program.cs index 74f137db..82f655c7 100644 --- a/samples/cs/tutorial-tool-calling/Program.cs +++ b/samples/cs/tutorial-tool-calling/Program.cs @@ -182,14 +182,14 @@ await model.DownloadAsync(progress => foreach (var toolCall in choice.ToolCalls) { var toolArgs = JsonDocument.Parse( - toolCall.FunctionCall.Arguments + toolCall.FunctionCall!.Arguments! ).RootElement; Console.WriteLine( $" Tool call: {toolCall.FunctionCall.Name}({toolArgs})" ); var result = ExecuteTool( - toolCall.FunctionCall.Name, toolArgs + toolCall.FunctionCall.Name!, toolArgs ); messages.Add(new ChatMessage {