From 77e5f527c459975fec6ffbd2da536dc4e2243fcc Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Tue, 30 Sep 2025 04:36:06 -0400 Subject: [PATCH] .NET: Clean up stale mentions of M.E.AI.Agents (#997) * Clean up stale mentions of M.E.AI.Agents * Unused usings --- .../ServiceDefaultsExtensions.cs | 2 +- .../GettingStarted/AgentOpenTelemetry/Program.cs | 7 ++----- .../Agents/Agent_Step08_Observability/Program.cs | 3 --- .../AgentHostingJsonUtilities.cs | 2 +- .../AzureAgentProvider.cs | 1 - .../Extensions/AgentProviderExtensions.cs | 1 - .../ObjectModel/InvokeAzureAgentExecutor.cs | 1 - .../WorkflowAgentProvider.cs | 1 - .../AIAgentsAbstractionsExtensions.cs | 1 - .../AgentRunResponseEvent.cs | 1 - .../AgentRunUpdateEvent.cs | 1 - .../AgentWorkflowBuilder.cs | 1 - .../ChatProtocolExecutor.cs | 2 +- .../Microsoft.Agents.AI.Workflows/ExecutorIsh.cs | 1 - .../InProc/InProcessRunnerContext.cs | 2 +- .../MessageMerger.cs | 1 - .../Specialized/AIAgentHostExecutor.cs | 1 - .../Microsoft.Agents.AI.Workflows/TurnToken.cs | 2 -- .../WorkflowHostAgent.cs | 1 - .../WorkflowHostingExtensions.cs | 1 - .../WorkflowMessageStore.cs | 1 - .../WorkflowThread.cs | 1 - .../WorkflowsJsonUtilities.cs | 4 ++-- .../Microsoft.Agents.AI/OpenTelemetryAgent.cs | 2 +- .../Microsoft.Agents.AI/OpenTelemetryConsts.cs | 4 ++-- .../PersistentAgentsClientExtensionsTests.cs | 3 ++- .../OpenTelemetryAgentTests.cs | 16 ++++++++-------- .../AzureAgentProviderTest.cs | 1 - .../AgentWorkflowBuilderTests.cs | 1 - .../ChatMessageBuilder.cs | 1 - .../MessageMergerTests.cs | 1 - .../RepresentationTests.cs | 1 - .../Sample/06_GroupChat_Workflow.cs | 1 - .../Sample/07_GroupChat_Workflow_HostAsAgent.cs | 1 - .../SpecializedExecutorSmokeTests.cs | 1 - 35 files changed, 21 insertions(+), 51 deletions(-) diff --git a/dotnet/samples/AgentWebChat/AgentWebChat.ServiceDefaults/ServiceDefaultsExtensions.cs b/dotnet/samples/AgentWebChat/AgentWebChat.ServiceDefaults/ServiceDefaultsExtensions.cs index 8ac81db3bf..00af0166c8 100644 --- a/dotnet/samples/AgentWebChat/AgentWebChat.ServiceDefaults/ServiceDefaultsExtensions.cs +++ b/dotnet/samples/AgentWebChat/AgentWebChat.ServiceDefaults/ServiceDefaultsExtensions.cs @@ -61,7 +61,7 @@ public static class ServiceDefaultsExtensions .WithTracing(tracing => { tracing.AddSource(builder.Environment.ApplicationName) - .AddSource("Microsoft.Extensions.AI.Agents") + .AddSource("*Microsoft.Agents.AI") .AddSource("Microsoft.Agents.AI.Runtime.InProcess") .AddSource("Microsoft.Agents.AI.Runtime.Abstractions.InMemoryActorStateStorage") .AddAspNetCoreInstrumentation() diff --git a/dotnet/samples/GettingStarted/AgentOpenTelemetry/Program.cs b/dotnet/samples/GettingStarted/AgentOpenTelemetry/Program.cs index 65c26cb526..d5c64ae416 100644 --- a/dotnet/samples/GettingStarted/AgentOpenTelemetry/Program.cs +++ b/dotnet/samples/GettingStarted/AgentOpenTelemetry/Program.cs @@ -20,9 +20,6 @@ using OpenTelemetry.Trace; const string SourceName = "OpenTelemetryAspire.ConsoleApp"; const string ServiceName = "AgentOpenTelemetry"; -// Enable telemetry for agents -AppContext.SetSwitch("Microsoft.Extensions.AI.Agents.EnableTelemetry", true); - // Configure OpenTelemetry for Aspire dashboard var otlpEndpoint = Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_ENDPOINT") ?? "http://localhost:4318"; @@ -40,7 +37,7 @@ var resource = ResourceBuilder.CreateDefault() using var tracerProvider = Sdk.CreateTracerProviderBuilder() .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService(ServiceName, serviceVersion: "1.0.0")) .AddSource(SourceName) // Our custom activity source - .AddSource("Microsoft.Extensions.AI.Agents") // Agent Framework telemetry + .AddSource("*Microsoft.Agents.AI") // Agent Framework telemetry .AddHttpClientInstrumentation() // Capture HTTP calls to OpenAI .AddOtlpExporter(options => options.Endpoint = new Uri(otlpEndpoint)) .Build(); @@ -49,7 +46,7 @@ using var tracerProvider = Sdk.CreateTracerProviderBuilder() using var meterProvider = Sdk.CreateMeterProviderBuilder() .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService(ServiceName, serviceVersion: "1.0.0")) .AddMeter(SourceName) // Our custom meter - .AddMeter("Microsoft.Extensions.AI.Agents") // Agent Framework metrics + .AddMeter("*Microsoft.Agents.AI") // Agent Framework metrics .AddHttpClientInstrumentation() // HTTP client metrics .AddRuntimeInstrumentation() // .NET runtime metrics .AddOtlpExporter(options => options.Endpoint = new Uri(otlpEndpoint)) diff --git a/dotnet/samples/GettingStarted/Agents/Agent_Step08_Observability/Program.cs b/dotnet/samples/GettingStarted/Agents/Agent_Step08_Observability/Program.cs index 481ed63f9e..7b34815cdf 100644 --- a/dotnet/samples/GettingStarted/Agents/Agent_Step08_Observability/Program.cs +++ b/dotnet/samples/GettingStarted/Agents/Agent_Step08_Observability/Program.cs @@ -16,9 +16,6 @@ var deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT const string JokerName = "Joker"; const string JokerInstructions = "You are good at telling jokes."; -// Enable telemetry -AppContext.SetSwitch("Microsoft.Extensions.AI.Agents.EnableTelemetry", true); - // Create TracerProvider with console exporter // This will output the telemetry data to the console. string sourceName = Guid.NewGuid().ToString("N"); diff --git a/dotnet/src/Microsoft.Agents.AI.Hosting/AgentHostingJsonUtilities.cs b/dotnet/src/Microsoft.Agents.AI.Hosting/AgentHostingJsonUtilities.cs index 649d87c83e..527525d92d 100644 --- a/dotnet/src/Microsoft.Agents.AI.Hosting/AgentHostingJsonUtilities.cs +++ b/dotnet/src/Microsoft.Agents.AI.Hosting/AgentHostingJsonUtilities.cs @@ -40,7 +40,7 @@ public static partial class AgentHostingJsonUtilities // Copy the configuration from the source generated context. JsonSerializerOptions options = new(JsonContext.Default.Options); - // Chain with all supported types from Microsoft.Extensions.AI.Agents.Abstractions. + // Chain with all supported types from Microsoft.Agents.AI.Abstractions. options.TypeInfoResolverChain.Add(AgentAbstractionsJsonUtilities.DefaultOptions.TypeInfoResolver!); options.TypeInfoResolverChain.Add(AgentRuntimeAbstractionsJsonUtilities.DefaultOptions.TypeInfoResolver!); diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/AzureAgentProvider.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/AzureAgentProvider.cs index f14cfe1d48..40d3eb6ba4 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/AzureAgentProvider.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/AzureAgentProvider.cs @@ -8,7 +8,6 @@ using System.Threading.Tasks; using Azure.AI.Agents.Persistent; using Azure.Core; using Azure.Core.Pipeline; -using Microsoft.Agents.AI; using Microsoft.Extensions.AI; namespace Microsoft.Agents.AI.Workflows.Declarative; diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Extensions/AgentProviderExtensions.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Extensions/AgentProviderExtensions.cs index a06c8e4122..184913280f 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Extensions/AgentProviderExtensions.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Extensions/AgentProviderExtensions.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; -using Microsoft.Agents.AI; using Microsoft.Extensions.AI; namespace Microsoft.Agents.AI.Workflows.Declarative.Extensions; diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/InvokeAzureAgentExecutor.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/InvokeAzureAgentExecutor.cs index ca21866833..b1e98f54a4 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/InvokeAzureAgentExecutor.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/InvokeAzureAgentExecutor.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; -using Microsoft.Agents.AI; using Microsoft.Agents.AI.Workflows.Declarative.Extensions; using Microsoft.Agents.AI.Workflows.Declarative.Interpreter; using Microsoft.Agents.AI.Workflows.Declarative.PowerFx; diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/WorkflowAgentProvider.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/WorkflowAgentProvider.cs index c9b52a3c74..39497eb72a 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/WorkflowAgentProvider.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/WorkflowAgentProvider.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using Microsoft.Agents.AI; using Microsoft.Extensions.AI; namespace Microsoft.Agents.AI.Workflows.Declarative; diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/AIAgentsAbstractionsExtensions.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/AIAgentsAbstractionsExtensions.cs index 4b265faaba..3d53d37f78 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/AIAgentsAbstractionsExtensions.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/AIAgentsAbstractionsExtensions.cs @@ -1,6 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using Microsoft.Agents.AI; using Microsoft.Extensions.AI; namespace Microsoft.Agents.AI.Workflows; diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/AgentRunResponseEvent.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/AgentRunResponseEvent.cs index cd0ed0d4ae..3f0013a88c 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/AgentRunResponseEvent.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/AgentRunResponseEvent.cs @@ -1,6 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using Microsoft.Agents.AI; using Microsoft.Shared.Diagnostics; namespace Microsoft.Agents.AI.Workflows; diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/AgentRunUpdateEvent.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/AgentRunUpdateEvent.cs index ba854fcf89..9fbf16b602 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/AgentRunUpdateEvent.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/AgentRunUpdateEvent.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; -using Microsoft.Agents.AI; using Microsoft.Shared.Diagnostics; namespace Microsoft.Agents.AI.Workflows; diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/AgentWorkflowBuilder.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/AgentWorkflowBuilder.cs index 08ba0f5d01..3d60d993d7 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/AgentWorkflowBuilder.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/AgentWorkflowBuilder.cs @@ -10,7 +10,6 @@ using System.Text.Json; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; -using Microsoft.Agents.AI; using Microsoft.Extensions.AI; using Microsoft.Shared.Diagnostics; diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/ChatProtocolExecutor.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/ChatProtocolExecutor.cs index e1eddebc5c..09e791b034 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/ChatProtocolExecutor.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/ChatProtocolExecutor.cs @@ -41,7 +41,7 @@ internal abstract class ChatProtocolExecutor(string id, ChatProtocolExecutorOpti public async ValueTask TakeTurnAsync(TurnToken token, IWorkflowContext context) { await this.TakeTurnAsync(this._pendingMessages, context, token.EmitEvents).ConfigureAwait(false); - this._pendingMessages = new(); + this._pendingMessages = []; await context.SendMessageAsync(token).ConfigureAwait(false); } diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/ExecutorIsh.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/ExecutorIsh.cs index f7e9add823..6ad3dfe4c7 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/ExecutorIsh.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/ExecutorIsh.cs @@ -3,7 +3,6 @@ using System; using System.Threading; using System.Threading.Tasks; -using Microsoft.Agents.AI; using Microsoft.Agents.AI.Workflows.Specialized; using Microsoft.Shared.Diagnostics; diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/InProc/InProcessRunnerContext.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/InProc/InProcessRunnerContext.cs index 7927529cce..4d2521ed48 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/InProc/InProcessRunnerContext.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/InProc/InProcessRunnerContext.cs @@ -29,7 +29,7 @@ internal sealed class InProcessRunnerContext : IRunnerContext private readonly ConcurrentDictionary> _executors = new(); private readonly ConcurrentQueue> _queuedExternalDeliveries = new(); - private readonly Dictionary _externalRequests = new(); + private readonly Dictionary _externalRequests = []; public InProcessRunnerContext(Workflow workflow, string runId, IStepTracer? stepTracer, ILogger? logger = null) { diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/MessageMerger.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/MessageMerger.cs index c8e4b7f346..8489d43f86 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/MessageMerger.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/MessageMerger.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; using System.Linq; -using Microsoft.Agents.AI; using Microsoft.Extensions.AI; using Microsoft.Shared.Diagnostics; diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/AIAgentHostExecutor.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/AIAgentHostExecutor.cs index 7b030f1171..0d6d18cf8d 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/AIAgentHostExecutor.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/AIAgentHostExecutor.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using System.Text.Json; using System.Threading; using System.Threading.Tasks; -using Microsoft.Agents.AI; using Microsoft.Extensions.AI; namespace Microsoft.Agents.AI.Workflows.Specialized; diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/TurnToken.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/TurnToken.cs index 6520a4ea21..7f65e3e9d3 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/TurnToken.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/TurnToken.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using Microsoft.Agents.AI; - namespace Microsoft.Agents.AI.Workflows; /// diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowHostAgent.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowHostAgent.cs index 41e1344d2e..c5625a12b6 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowHostAgent.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowHostAgent.cs @@ -9,7 +9,6 @@ using System.Runtime.CompilerServices; using System.Text.Json; using System.Threading; using System.Threading.Tasks; -using Microsoft.Agents.AI; using Microsoft.Extensions.AI; using Microsoft.Shared.Diagnostics; diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowHostingExtensions.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowHostingExtensions.cs index fb13a4bad2..aef92a7046 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowHostingExtensions.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowHostingExtensions.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using Microsoft.Agents.AI; using Microsoft.Extensions.AI; namespace Microsoft.Agents.AI.Workflows; diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowMessageStore.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowMessageStore.cs index 076ef24af4..2d656d50ce 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowMessageStore.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowMessageStore.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.Text.Json; using System.Threading; using System.Threading.Tasks; -using Microsoft.Agents.AI; using Microsoft.Extensions.AI; namespace Microsoft.Agents.AI.Workflows; diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowThread.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowThread.cs index 965bd49753..3b8766a09d 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowThread.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowThread.cs @@ -2,7 +2,6 @@ using System; using System.Text.Json; -using Microsoft.Agents.AI; using Microsoft.Extensions.AI; using Microsoft.Shared.Diagnostics; diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowsJsonUtilities.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowsJsonUtilities.cs index ebfd1acd4f..ef1186a64f 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowsJsonUtilities.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowsJsonUtilities.cs @@ -50,8 +50,8 @@ internal static partial class WorkflowsJsonUtilities // Copy the configuration from the source generated context. JsonSerializerOptions options = new(JsonContext.Default.Options); - // Chain with all supported types from Microsoft.Extensions.AI.Abstractions. and Microsoft.Extensions.AI.Agents.Abstractions. - options.TypeInfoResolverChain.Add(AIJsonUtilities.DefaultOptions.TypeInfoResolver!); + // Chain with all supported types from Microsoft.Extensions.AI.Abstractions and Microsoft.Agents.AI.Abstractions. + options.TypeInfoResolverChain.Add(AgentAbstractionsJsonUtilities.DefaultOptions.TypeInfoResolver!); options.MakeReadOnly(); return options; diff --git a/dotnet/src/Microsoft.Agents.AI/OpenTelemetryAgent.cs b/dotnet/src/Microsoft.Agents.AI/OpenTelemetryAgent.cs index bbbd4c1199..1fc4659aa8 100644 --- a/dotnet/src/Microsoft.Agents.AI/OpenTelemetryAgent.cs +++ b/dotnet/src/Microsoft.Agents.AI/OpenTelemetryAgent.cs @@ -50,7 +50,7 @@ public sealed partial class OpenTelemetryAgent : DelegatingAIAgent, IDisposable this._activitySource = new(name); this._meter = new(name); this._logger = logger ?? NullLogger.Instance; - this._system = this.GetService()?.ProviderName ?? OpenTelemetryConsts.GenAI.SystemNameValues.MicrosoftExtensionsAIAgents; + this._system = this.GetService()?.ProviderName ?? OpenTelemetryConsts.GenAI.SystemNameValues.MicrosoftAgentsAI; // Attempt to get the open telemetry chat client if the inner agent is a ChatClientAgent. this._openTelemetryChatClient = (this.InnerAgent as ChatClientAgent)?.ChatClient.GetService(); diff --git a/dotnet/src/Microsoft.Agents.AI/OpenTelemetryConsts.cs b/dotnet/src/Microsoft.Agents.AI/OpenTelemetryConsts.cs index fa5d86f514..152ab793f0 100644 --- a/dotnet/src/Microsoft.Agents.AI/OpenTelemetryConsts.cs +++ b/dotnet/src/Microsoft.Agents.AI/OpenTelemetryConsts.cs @@ -5,7 +5,7 @@ namespace Microsoft.Agents.AI; /// Provides constants used by various telemetry services. internal static class OpenTelemetryConsts { - public const string DefaultSourceName = "Experimental.Microsoft.Extensions.AI.Agents"; + public const string DefaultSourceName = "Experimental.Microsoft.Agents.AI"; public const string SecondsUnit = "s"; public const string TokensUnit = "token"; @@ -28,7 +28,7 @@ internal static class OpenTelemetryConsts public static class SystemNameValues { - public const string MicrosoftExtensionsAIAgents = "microsoft.extensions.ai.agents"; + public const string MicrosoftAgentsAI = "microsoft.agents.ai"; } public const string Chat = "chat"; diff --git a/dotnet/tests/Microsoft.Agents.AI.AzureAI.UnitTests/Extensions/PersistentAgentsClientExtensionsTests.cs b/dotnet/tests/Microsoft.Agents.AI.AzureAI.UnitTests/Extensions/PersistentAgentsClientExtensionsTests.cs index 42f643fb34..7e252c84ae 100644 --- a/dotnet/tests/Microsoft.Agents.AI.AzureAI.UnitTests/Extensions/PersistentAgentsClientExtensionsTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.AzureAI.UnitTests/Extensions/PersistentAgentsClientExtensionsTests.cs @@ -10,9 +10,10 @@ using System.Threading.Tasks; using Azure; using Azure.AI.Agents.Persistent; using Azure.Core; +using Microsoft.Extensions.AI; using Moq; -namespace Microsoft.Extensions.AI.Agents.AzureAI.UnitTests.Extensions; +namespace Microsoft.Agents.AI.AzureAI.UnitTests.Extensions; public sealed class PersistentAgentsClientExtensionsTests { diff --git a/dotnet/tests/Microsoft.Agents.AI.UnitTests/OpenTelemetryAgentTests.cs b/dotnet/tests/Microsoft.Agents.AI.UnitTests/OpenTelemetryAgentTests.cs index 55bfcd74b5..04165186c2 100644 --- a/dotnet/tests/Microsoft.Agents.AI.UnitTests/OpenTelemetryAgentTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.UnitTests/OpenTelemetryAgentTests.cs @@ -65,7 +65,7 @@ public class OpenTelemetryAgentTests // Verify activity tags Assert.Equal(OpenTelemetryConsts.GenAI.Operation.NameValues.InvokeAgent, activity.GetTagItem(OpenTelemetryConsts.GenAI.Operation.Name)); - Assert.Equal(OpenTelemetryConsts.GenAI.SystemNameValues.MicrosoftExtensionsAIAgents, activity.GetTagItem(OpenTelemetryConsts.GenAI.SystemName)); + Assert.Equal(OpenTelemetryConsts.GenAI.SystemNameValues.MicrosoftAgentsAI, activity.GetTagItem(OpenTelemetryConsts.GenAI.SystemName)); Assert.Equal("test-agent-id", activity.GetTagItem(OpenTelemetryConsts.GenAI.Agent.Id)); Assert.Equal("TestAgent", activity.GetTagItem(OpenTelemetryConsts.GenAI.Agent.Name)); Assert.Equal("Test Description", activity.GetTagItem(OpenTelemetryConsts.GenAI.Agent.Description)); @@ -141,7 +141,7 @@ public class OpenTelemetryAgentTests // Verify activity tags Assert.Equal(OpenTelemetryConsts.GenAI.Operation.NameValues.InvokeAgent, activity.GetTagItem(OpenTelemetryConsts.GenAI.Operation.Name)); - Assert.Equal(OpenTelemetryConsts.GenAI.SystemNameValues.MicrosoftExtensionsAIAgents, activity.GetTagItem(OpenTelemetryConsts.GenAI.SystemName)); + Assert.Equal(OpenTelemetryConsts.GenAI.SystemNameValues.MicrosoftAgentsAI, activity.GetTagItem(OpenTelemetryConsts.GenAI.SystemName)); Assert.Equal("test-agent-id", activity.GetTagItem(OpenTelemetryConsts.GenAI.Agent.Id)); Assert.Equal("TestAgent", activity.GetTagItem(OpenTelemetryConsts.GenAI.Agent.Name)); Assert.Equal("Test Description", activity.GetTagItem(OpenTelemetryConsts.GenAI.Agent.Description)); @@ -198,7 +198,7 @@ public class OpenTelemetryAgentTests var activity = Assert.Single(activities); Assert.Equal("You are a helpful assistant.", activity.GetTagItem(OpenTelemetryConsts.GenAI.Request.Instructions)); // Should use default system when ChatClientMetadata is not available - Assert.Equal(OpenTelemetryConsts.GenAI.SystemNameValues.MicrosoftExtensionsAIAgents, activity.GetTagItem(OpenTelemetryConsts.GenAI.SystemName)); + Assert.Equal(OpenTelemetryConsts.GenAI.SystemNameValues.MicrosoftAgentsAI, activity.GetTagItem(OpenTelemetryConsts.GenAI.SystemName)); } [Fact] @@ -270,7 +270,7 @@ public class OpenTelemetryAgentTests // Assert var activity = Assert.Single(activities); // Should use default system when agent is not a ChatClientAgent - Assert.Equal(OpenTelemetryConsts.GenAI.SystemNameValues.MicrosoftExtensionsAIAgents, activity.GetTagItem(OpenTelemetryConsts.GenAI.SystemName)); + Assert.Equal(OpenTelemetryConsts.GenAI.SystemNameValues.MicrosoftAgentsAI, activity.GetTagItem(OpenTelemetryConsts.GenAI.SystemName)); } [Theory] @@ -1179,8 +1179,8 @@ public class OpenTelemetryAgentTests // Assert var activity = Assert.Single(activities); - // Verify that the system defaults to "microsoft.extensions.ai.agents" when no metadata is available - Assert.Equal("microsoft.extensions.ai.agents", activity.GetTagItem(OpenTelemetryConsts.GenAI.SystemName)); + // Verify that the system defaults to "microsoft.agents.ai" when no metadata is available + Assert.Equal("microsoft.agents.ai", activity.GetTagItem(OpenTelemetryConsts.GenAI.SystemName)); // Verify that GetService returns null provider name var agentMetadata = telemetryAgent.GetService(typeof(AIAgentMetadata)) as AIAgentMetadata; @@ -1271,8 +1271,8 @@ public class OpenTelemetryAgentTests // Assert var activity = Assert.Single(activities); - // Verify that the system defaults to "microsoft.extensions.ai.agents" when no metadata is available - Assert.Equal("microsoft.extensions.ai.agents", activity.GetTagItem(OpenTelemetryConsts.GenAI.SystemName)); + // Verify that the system defaults to "microsoft.agents.ai" when no metadata is available + Assert.Equal("microsoft.agents.ai", activity.GetTagItem(OpenTelemetryConsts.GenAI.SystemName)); // Verify that GetService returns null for metadata var agentMetadata = telemetryAgent.GetService(typeof(AIAgentMetadata)) as AIAgentMetadata; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/AzureAgentProviderTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/AzureAgentProviderTest.cs index e67431cebb..45b7735eb9 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/AzureAgentProviderTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/AzureAgentProviderTest.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; using Azure; using Azure.AI.Agents.Persistent; using Azure.Identity; -using Microsoft.Agents.AI; using Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.Framework; using Microsoft.Extensions.AI; using Microsoft.Extensions.Configuration; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/AgentWorkflowBuilderTests.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/AgentWorkflowBuilderTests.cs index 0c0dd82897..8fc5153f03 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/AgentWorkflowBuilderTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/AgentWorkflowBuilderTests.cs @@ -8,7 +8,6 @@ using System.Text; using System.Text.Json; using System.Threading; using System.Threading.Tasks; -using Microsoft.Agents.AI; using Microsoft.Extensions.AI; #pragma warning disable SYSLIB1045 // Use GeneratedRegex diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/ChatMessageBuilder.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/ChatMessageBuilder.cs index 4e9218a6f2..659babe7e1 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/ChatMessageBuilder.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/ChatMessageBuilder.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; using System.Linq; -using Microsoft.Agents.AI; using Microsoft.Extensions.AI; namespace Microsoft.Agents.AI.Workflows.UnitTests; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/MessageMergerTests.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/MessageMergerTests.cs index 9373baed18..793d01673e 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/MessageMergerTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/MessageMergerTests.cs @@ -2,7 +2,6 @@ using System; using FluentAssertions; -using Microsoft.Agents.AI; using Microsoft.Extensions.AI; namespace Microsoft.Agents.AI.Workflows.UnitTests; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/RepresentationTests.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/RepresentationTests.cs index 5ffdfaa849..088f2af816 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/RepresentationTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/RepresentationTests.cs @@ -6,7 +6,6 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; using FluentAssertions; -using Microsoft.Agents.AI; using Microsoft.Agents.AI.Workflows.Checkpointing; using Microsoft.Agents.AI.Workflows.Sample; using Microsoft.Agents.AI.Workflows.Specialized; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/Sample/06_GroupChat_Workflow.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/Sample/06_GroupChat_Workflow.cs index bfcbb99708..2f9eaf0d32 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/Sample/06_GroupChat_Workflow.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/Sample/06_GroupChat_Workflow.cs @@ -10,7 +10,6 @@ using System.Text; using System.Text.Json; using System.Threading; using System.Threading.Tasks; -using Microsoft.Agents.AI; using Microsoft.Extensions.AI; namespace Microsoft.Agents.AI.Workflows.Sample; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/Sample/07_GroupChat_Workflow_HostAsAgent.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/Sample/07_GroupChat_Workflow_HostAsAgent.cs index b9ebff92cc..39bf2cb626 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/Sample/07_GroupChat_Workflow_HostAsAgent.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/Sample/07_GroupChat_Workflow_HostAsAgent.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.IO; using System.Threading.Tasks; -using Microsoft.Agents.AI; using Microsoft.Extensions.AI; namespace Microsoft.Agents.AI.Workflows.Sample; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/SpecializedExecutorSmokeTests.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/SpecializedExecutorSmokeTests.cs index c194bfd868..75a8bd6af0 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/SpecializedExecutorSmokeTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/SpecializedExecutorSmokeTests.cs @@ -8,7 +8,6 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; using FluentAssertions; -using Microsoft.Agents.AI; using Microsoft.Agents.AI.Workflows.Specialized; using Microsoft.Extensions.AI;