Skip to content
Merged
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
3 changes: 1 addition & 2 deletions common/Perf/Azure.Test.Perf/Azure.Test.Perf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
Perf framework should depend on lowest version of Azure.Core for maximum compat, allowing test
projects to choose a higher version if desired.
-->
<PackageReference Include="Azure.Core" VersionOverride="1.0.0" />
<PackageReference Include="Azure.Core" VersionOverride="1.40.0" />
Comment thread
jsquire marked this conversation as resolved.
<PackageReference Include="CommandLineParser" />
<PackageReference Include="System.Reflection.Emit" />
<PackageReference Include="System.Text.Json" />
<PackageReference Include="System.Threading.Channels" />
<PackageReference Include="BenchmarkDotNet" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" />
Expand Down
7 changes: 4 additions & 3 deletions eng/Directory.Build.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
<PackageRootDirectory>$([MSBuild]::NormalizeDirectory($(MSBuildProjectDirectory)/../).TrimEnd("/").TrimEnd("\\"))</PackageRootDirectory>

<!--
For API compat checks, libraries that don't release often are likely to not have the new LTS target,
For API compat checks, libraries that don't release often are likely to not have newer targets,
but will always have a baseline. Since the guidelines require that the API surface be the same accross
all supported targets, we can use the baseline for API compat checks to avoid breaking builds.
-->
<ApiCompatBaselineTargetFramework Condition="'$(ApiCompatBaselineTargetFramework)' == '' AND $(RequiredRunnableTargetFrameworks.Contains('$(TargetFramework)')) AND '$(SupportsNetStandard20)' == 'true'">$(ApiCompatStandardTargetFramework)</ApiCompatBaselineTargetFramework>
<ApiCompatBaselineTargetFramework Condition="'$(ApiCompatBaselineTargetFramework)' == '' AND '$(TargetFramework)' == '$(LtsTargetFramework)' AND '$(SupportsNetStandard20)' != 'true'">$(ApiCompatRunnableTargetFramework)</ApiCompatBaselineTargetFramework>
<ApiCompatBaselineTargetFramework Condition="'$(ApiCompatBaselineTargetFramework)' == '' AND '$(SupportsNetStandard20)' == 'true'">$(ApiCompatStandardTargetFramework)</ApiCompatBaselineTargetFramework>
<ApiCompatBaselineTargetFramework Condition="'$(ApiCompatBaselineTargetFramework)' == '' AND '$(SupportsNetStandard20)' != 'true'">$(ApiCompatRunnableTargetFramework)</ApiCompatBaselineTargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(IsShippingLibrary)' == 'true' and '$(AotCompatOptOut)' == 'false'">
Expand Down Expand Up @@ -176,6 +176,7 @@
<PackageReference Remove="Microsoft.CSharp" />
<PackageReference Remove="System.Formats.Asn1" />
<PackageReference Remove="System.Linq.Async" />
<PackageReference Remove="System.Linq.AsyncEnumerable" />
<PackageReference Remove="System.IO.Compression" />
<PackageReference Remove="System.Net.WebSockets.Client" />
<PackageReference Remove="System.Reflection.Emit" />
Expand Down
395 changes: 198 additions & 197 deletions eng/Packages.Data.props

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,18 @@
<ProjectReference Include="$(AzureCoreTestFramework)" />
<ProjectReference Include="..\src\Azure.AI.Agents.Persistent.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Azure.Monitor.OpenTelemetry.Exporter" />
<PackageReference Include="NUnit" />
<PackageReference Include="NUnit3TestAdapter" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Moq" />
<PackageReference Include="OpenTelemetry" />
<PackageReference Include="OpenTelemetry.Exporter.Console" />
<PackageReference Include="System.Linq.Async" />
<PackageReference Include="System.Linq.AsyncEnumerable" />
</ItemGroup>

<ItemGroup>
<Folder Include="SessionRecords\" />
</ItemGroup>
</Project>
</Project>
1 change: 0 additions & 1 deletion sdk/ai/Azure.AI.Inference/src/Azure.AI.Inference.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Azure.Core" />
<PackageReference Include="System.ClientModel" />
</ItemGroup>

</Project>
1 change: 0 additions & 1 deletion sdk/ai/Azure.AI.Projects/src/Azure.AI.Projects.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

<ItemGroup>
<PackageReference Include="Azure.Core" />
<PackageReference Include="System.ClientModel" />
<PackageReference Include="Azure.Identity" />
<PackageReference Include="Azure.Storage.Blobs" />
<PackageReference Include="Azure.AI.OpenAI" />
Expand Down
14 changes: 6 additions & 8 deletions sdk/ai/Azure.AI.Projects/tests/Azure.AI.Projects.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>

Expand All @@ -11,25 +11,23 @@
<ProjectReference Include="$(AzureCoreTestFramework)" />
<ProjectReference Include="..\src\Azure.AI.Projects.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Azure.AI.Agents.Persistent" VersionOverride="1.0.0" />
<PackageReference Include="Azure.AI.OpenAI" VersionOverride="2.2.0-beta.4" />
<PackageReference Include="Azure.AI.Agents.Persistent" />
<PackageReference Include="Azure.AI.OpenAI" />
<PackageReference Include="Azure.AI.Inference" />
<PackageReference Include="NUnit" />
<PackageReference Include="NUnit3TestAdapter" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Moq" />
<PackageReference Include="Azure.ResourceManager" />
<PackageReference Include="Azure.ResourceManager.CognitiveServices" />
<PackageReference Include="OpenTelemetry" />
<PackageReference Include="OpenTelemetry.Exporter.Console" />
<PackageReference Include="Azure.Monitor.OpenTelemetry.Exporter" />
<PackageReference Include="System.Linq.Async" />
<PackageReference Include="System.Linq.AsyncEnumerable" />
<PackageReference Include="System.Text.Json" />
</ItemGroup>

<ItemGroup>
<Folder Include="SessionRecords\" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License.

using System.CommandLine;
using System.CommandLine.Parsing;
using Azure.AI.VoiceLive.Samples;
using Azure.Core;
using Azure.Core.Pipeline;
Expand Down Expand Up @@ -45,80 +46,76 @@ public class SampleProgram
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
public static async Task<int> Main(string[] args)
{
// Create command line interface
var rootCommand = CreateRootCommand();
return await rootCommand.InvokeAsync(args).ConfigureAwait(false);
}
public static async Task<int> Main(string[] args)
{
var rootCommand = new RootCommand("Basic Voice Assistant using Azure VoiceLive SDK");

private static RootCommand CreateRootCommand()
var apiKeyOption = new Option<string?>("--api-key")
{
var rootCommand = new RootCommand("Basic Voice Assistant using Azure VoiceLive SDK");

var apiKeyOption = new Option<string?>(
"--api-key",
"Azure VoiceLive API key. If not provided, will use AZURE_VOICELIVE_API_KEY environment variable.");
Description = "Azure VoiceLive API key. If not provided, will use AZURE_VOICELIVE_API_KEY environment variable."
};

var endpointOption = new Option<string>(
"--endpoint",
() => "wss://api.voicelive.com/v1",
"Azure VoiceLive endpoint");
var endpointOption = new Option<string>("--endpoint")
{
Description = "Azure VoiceLive endpoint"
};

var modelOption = new Option<string>(
"--model",
() => "gpt-4o",
"VoiceLive model to use");
var modelOption = new Option<string>("--model")
{
Description = "VoiceLive model to use"
};

var voiceOption = new Option<string>(
"--voice",
() => "en-US-AvaNeural",
"Voice to use for the assistant");
var voiceOption = new Option<string>("--voice")
{
Description = "Voice to use for the assistant"
};

var instructionsOption = new Option<string>(
"--instructions",
() => "You are a helpful AI assistant. Respond naturally and conversationally. Keep your responses concise but engaging.",
"System instructions for the AI assistant");
var instructionsOption = new Option<string>("--instructions")
{
Description = "System instructions for the AI assistant"
};

var useTokenCredentialOption = new Option<bool>(
"--use-token-credential",
"Use Azure token credential instead of API key");
var useTokenCredentialOption = new Option<bool>("--use-token-credential")
{
Description = "Use Azure token credential instead of API key"
};

var verboseOption = new Option<bool>(
"--verbose",
"Enable verbose logging");
var verboseOption = new Option<bool>("--verbose")
{
Description = "Enable verbose logging"
};

rootCommand.AddOption(apiKeyOption);
rootCommand.AddOption(endpointOption);
rootCommand.AddOption(modelOption);
rootCommand.AddOption(voiceOption);
rootCommand.AddOption(instructionsOption);
rootCommand.AddOption(useTokenCredentialOption);
rootCommand.AddOption(verboseOption);
rootCommand.Add(apiKeyOption);
rootCommand.Add(endpointOption);
rootCommand.Add(modelOption);
rootCommand.Add(voiceOption);
rootCommand.Add(instructionsOption);
rootCommand.Add(useTokenCredentialOption);
rootCommand.Add(verboseOption);

rootCommand.SetHandler(async (
string? apiKey,
string endpoint,
string model,
string voice,
string instructions,
bool useTokenCredential,
bool verbose) =>
var parseResult = rootCommand.Parse(args);
if (parseResult.Errors.Count > 0)
{
foreach (var error in parseResult.Errors)
{
await RunVoiceAssistantAsync(apiKey, endpoint, model, voice, instructions, useTokenCredential, verbose).ConfigureAwait(false);
},
apiKeyOption,
endpointOption,
modelOption,
voiceOption,
instructionsOption,
useTokenCredentialOption,
verboseOption);

return rootCommand;
Console.WriteLine(error.Message);
}
return 1;
}

private static async Task RunVoiceAssistantAsync(
var apiKey = parseResult.GetValue(apiKeyOption);
var endpoint = parseResult.GetValue(endpointOption) ?? "wss://api.voicelive.com/v1";
var model = parseResult.GetValue(modelOption) ?? "gpt-4o";
var voice = parseResult.GetValue(voiceOption) ?? "en-US-AvaNeural";
var instructions = parseResult.GetValue(instructionsOption) ?? "You are a helpful AI assistant. Respond naturally and conversationally. Keep your responses concise but engaging.";
var useTokenCredential = parseResult.GetValue(useTokenCredentialOption);
var verbose = parseResult.GetValue(verboseOption);

await RunVoiceAssistantAsync(apiKey, endpoint, model, voice, instructions, useTokenCredential, verbose).ConfigureAwait(false);
return 0;
}

private static async Task RunVoiceAssistantAsync(
string? apiKey,
string endpoint,
string model,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License.

using System.CommandLine;
using System.CommandLine.Parsing;
using Azure.AI.VoiceLive.Samples;
using Azure.Core;
using Azure.Core.Pipeline;
Expand Down Expand Up @@ -51,76 +52,72 @@ public class SampleProgram
/// <param name="args"></param>
/// <returns></returns>
public static async Task<int> Main(string[] args)
{
// Create command line interface
var rootCommand = CreateRootCommand();
return await rootCommand.InvokeAsync(args).ConfigureAwait(false);
}

private static RootCommand CreateRootCommand()
{
var rootCommand = new RootCommand("Customer Service Bot using Azure VoiceLive SDK with Function Calling");

var apiKeyOption = new Option<string?>(
"--api-key",
"Azure VoiceLive API key. If not provided, will use AZURE_VOICELIVE_API_KEY environment variable.");
var apiKeyOption = new Option<string?>("--api-key")
{
Description = "Azure VoiceLive API key. If not provided, will use AZURE_VOICELIVE_API_KEY environment variable."
};

var endpointOption = new Option<string>(
"--endpoint",
() => "wss://api.voicelive.com/v1",
"Azure VoiceLive endpoint");
var endpointOption = new Option<string>("--endpoint")
{
Description = "Azure VoiceLive endpoint"
};

var modelOption = new Option<string>(
"--model",
() => "gpt-4o",
"VoiceLive model to use");
var modelOption = new Option<string>("--model")
{
Description = "VoiceLive model to use"
};

var voiceOption = new Option<string>(
"--voice",
() => "en-US-JennyNeural",
"Voice to use for the customer service bot");
var voiceOption = new Option<string>("--voice")
{
Description = "Voice to use for the customer service bot"
};

var instructionsOption = new Option<string>(
"--instructions",
() => "You are a professional customer service representative for TechCorp. You have access to customer databases and order systems. Always be polite, helpful, and efficient. When customers ask about orders, accounts, or need to schedule service, use the available tools to provide accurate, real-time information. Keep your responses concise but thorough.",
"System instructions for the customer service bot");
var instructionsOption = new Option<string>("--instructions")
{
Description = "System instructions for the customer service bot"
};

var useTokenCredentialOption = new Option<bool>(
"--use-token-credential",
"Use Azure token credential instead of API key");
var useTokenCredentialOption = new Option<bool>("--use-token-credential")
{
Description = "Use Azure token credential instead of API key"
};

var verboseOption = new Option<bool>(
"--verbose",
"Enable verbose logging");
var verboseOption = new Option<bool>("--verbose")
{
Description = "Enable verbose logging"
};

rootCommand.AddOption(apiKeyOption);
rootCommand.AddOption(endpointOption);
rootCommand.AddOption(modelOption);
rootCommand.AddOption(voiceOption);
rootCommand.AddOption(instructionsOption);
rootCommand.AddOption(useTokenCredentialOption);
rootCommand.AddOption(verboseOption);
rootCommand.Add(apiKeyOption);
rootCommand.Add(endpointOption);
rootCommand.Add(modelOption);
rootCommand.Add(voiceOption);
rootCommand.Add(instructionsOption);
rootCommand.Add(useTokenCredentialOption);
rootCommand.Add(verboseOption);

rootCommand.SetHandler(async (
string? apiKey,
string endpoint,
string model,
string voice,
string instructions,
bool useTokenCredential,
bool verbose) =>
var parseResult = rootCommand.Parse(args);
if (parseResult.Errors.Count > 0)
{
await RunCustomerServiceBotAsync(apiKey, endpoint, model, voice, instructions, useTokenCredential, verbose).ConfigureAwait(false);
},
apiKeyOption,
endpointOption,
modelOption,
voiceOption,
instructionsOption,
useTokenCredentialOption,
verboseOption);
foreach (var error in parseResult.Errors)
{
Console.WriteLine(error.Message);
}
return 1;
}

var apiKey = parseResult.GetValue(apiKeyOption);
var endpoint = parseResult.GetValue(endpointOption) ?? "wss://api.voicelive.com/v1";
var model = parseResult.GetValue(modelOption) ?? "gpt-4o";
var voice = parseResult.GetValue(voiceOption) ?? "en-US-JennyNeural";
var instructions = parseResult.GetValue(instructionsOption) ?? "You are a professional customer service representative for TechCorp. You have access to customer databases and order systems. Always be polite, helpful, and efficient. When customers ask about orders, accounts, or need to schedule service, use the available tools to provide accurate, real-time information. Keep your responses concise but thorough.";
var useTokenCredential = parseResult.GetValue(useTokenCredentialOption);
var verbose = parseResult.GetValue(verboseOption);

return rootCommand;
await RunCustomerServiceBotAsync(apiKey, endpoint, model, voice, instructions, useTokenCredential, verbose).ConfigureAwait(false);
return 0;
}

private static async Task RunCustomerServiceBotAsync(
Expand Down
Loading
Loading