Rename Agent to AIAgent and instroduce DisplayName (#201)

This commit is contained in:
westey
2025-07-18 16:43:38 +01:00
committed by GitHub
Unverified
parent 6e57489a44
commit fc999e2be8
37 changed files with 106 additions and 98 deletions
@@ -3,7 +3,7 @@
namespace Microsoft.Extensions.AI.Agents;
/// <summary>
/// Extension methods for <see cref="Agent"/>.
/// Extension methods for <see cref="AIAgent"/>.
/// </summary>
public static class AgentExtensions
{
@@ -13,7 +13,7 @@ public static class AgentExtensions
/// <param name="agent">The agent to wrap.</param>
/// <param name="sourceName">An optional source name that will be used on the telemetry data.</param>
/// <returns>An <see cref="OpenTelemetryAgent"/> that wraps the original agent with telemetry.</returns>
public static OpenTelemetryAgent WithOpenTelemetry(this Agent agent, string? sourceName = null)
public static OpenTelemetryAgent WithOpenTelemetry(this AIAgent agent, string? sourceName = null)
{
return new OpenTelemetryAgent(agent, sourceName);
}
@@ -15,7 +15,7 @@ namespace Microsoft.Extensions.AI.Agents;
/// <summary>
/// Represents an agent that can be invoked using a chat client.
/// </summary>
public sealed class ChatClientAgent : Agent
public sealed class ChatClientAgent : AIAgent
{
private readonly ChatClientAgentOptions? _agentOptions;
private readonly ILogger _logger;
@@ -18,9 +18,9 @@ namespace Microsoft.Extensions.AI.Agents;
/// This class provides telemetry instrumentation for agent operations including activities, metrics, and logging.
/// The telemetry output follows OpenTelemetry semantic conventions in <see href="https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-agent-spans/"/> and is subject to change as the conventions evolve.
/// </remarks>
public sealed class OpenTelemetryAgent : Agent, IDisposable
public sealed class OpenTelemetryAgent : AIAgent, IDisposable
{
private readonly Agent _innerAgent;
private readonly AIAgent _innerAgent;
private readonly ActivitySource _activitySource;
private readonly Meter _meter;
private readonly Histogram<double> _operationDurationHistogram;
@@ -32,7 +32,7 @@ public sealed class OpenTelemetryAgent : Agent, IDisposable
/// </summary>
/// <param name="innerAgent">The underlying agent to wrap with telemetry.</param>
/// <param name="sourceName">An optional source name that will be used on the telemetry data.</param>
public OpenTelemetryAgent(Agent innerAgent, string? sourceName = null)
public OpenTelemetryAgent(AIAgent innerAgent, string? sourceName = null)
{
this._innerAgent = Throw.IfNull(innerAgent);