mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
32e054f1fe
* Rename AI Agent packages to use Microsoft.Agents.AI * Fix for build * Fix formatting * Fix formatting * Ignore in VSTHRD200 in migration samples * Ignore in VSTHRD200 in migration samples * Add some missing projects and run format * Fix build errors * Address code review feedback * Fix merge issues --------- Co-authored-by: Mark Wallace <markwallace@microsoft.com>
155 lines
5.3 KiB
C#
155 lines
5.3 KiB
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
namespace Microsoft.Agents.AI;
|
|
|
|
/// <summary>Provides constants used by various telemetry services.</summary>
|
|
internal static class OpenTelemetryConsts
|
|
{
|
|
public const string DefaultSourceName = "Experimental.Microsoft.Extensions.AI.Agents";
|
|
|
|
public const string SecondsUnit = "s";
|
|
public const string TokensUnit = "token";
|
|
|
|
public static class Event
|
|
{
|
|
public const string Name = "event.name";
|
|
}
|
|
|
|
public static class Error
|
|
{
|
|
public const string Type = "error.type";
|
|
}
|
|
|
|
public static class GenAI
|
|
{
|
|
public const string Choice = "gen_ai.choice";
|
|
|
|
public const string SystemName = "gen_ai.system";
|
|
|
|
public static class SystemNameValues
|
|
{
|
|
public const string MicrosoftExtensionsAIAgents = "microsoft.extensions.ai.agents";
|
|
}
|
|
|
|
public const string Chat = "chat";
|
|
public const string Embeddings = "embeddings";
|
|
public const string ExecuteTool = "execute_tool";
|
|
|
|
public static class Agent
|
|
{
|
|
public const string Id = "gen_ai.agent.id";
|
|
public const string Name = "gen_ai.agent.name";
|
|
public const string Description = "gen_ai.agent.description";
|
|
}
|
|
|
|
public static class Assistant
|
|
{
|
|
public const string Message = "gen_ai.assistant.message";
|
|
}
|
|
|
|
public static class Client
|
|
{
|
|
public static class OperationDuration
|
|
{
|
|
public const string Description = "Measures the duration of a GenAI operation";
|
|
public const string Name = "gen_ai.client.operation.duration";
|
|
public static readonly double[] ExplicitBucketBoundaries = [0.01, 0.02, 0.04, 0.08, 0.16, 0.32, 0.64, 1.28, 2.56, 5.12, 10.24, 20.48, 40.96, 81.92];
|
|
}
|
|
|
|
public static class TokenUsage
|
|
{
|
|
public const string Description = "Measures number of input and output tokens used";
|
|
public const string Name = "gen_ai.client.token.usage";
|
|
public static readonly int[] ExplicitBucketBoundaries = [1, 4, 16, 64, 256, 1_024, 4_096, 16_384, 65_536, 262_144, 1_048_576, 4_194_304, 16_777_216, 67_108_864];
|
|
}
|
|
}
|
|
|
|
public static class Conversation
|
|
{
|
|
public const string Id = "gen_ai.conversation.id";
|
|
}
|
|
|
|
public static class Operation
|
|
{
|
|
public const string Name = "gen_ai.operation.name";
|
|
|
|
public static class NameValues
|
|
{
|
|
public const string InvokeAgent = "invoke_agent";
|
|
}
|
|
}
|
|
|
|
public static class Output
|
|
{
|
|
public const string Type = "gen_ai.output.type";
|
|
}
|
|
|
|
public static class Request
|
|
{
|
|
public const string EmbeddingDimensions = "gen_ai.request.embedding.dimensions";
|
|
public const string FrequencyPenalty = "gen_ai.request.frequency_penalty";
|
|
public const string Model = "gen_ai.request.model";
|
|
public const string MaxTokens = "gen_ai.request.max_tokens";
|
|
public const string PresencePenalty = "gen_ai.request.presence_penalty";
|
|
public const string Seed = "gen_ai.request.seed";
|
|
public const string StopSequences = "gen_ai.request.stop_sequences";
|
|
public const string Temperature = "gen_ai.request.temperature";
|
|
public const string TopK = "gen_ai.request.top_k";
|
|
public const string TopP = "gen_ai.request.top_p";
|
|
|
|
// Not available in OTEL : Potential proposals
|
|
public const string Instructions = "gen_ai.request.instructions";
|
|
|
|
public static string PerProvider(string providerName, string parameterName) => $"gen_ai.{providerName}.request.{parameterName}";
|
|
}
|
|
|
|
public static class Response
|
|
{
|
|
public const string FinishReasons = "gen_ai.response.finish_reasons";
|
|
public const string Id = "gen_ai.response.id";
|
|
public const string Model = "gen_ai.response.model";
|
|
|
|
public static string PerProvider(string providerName, string parameterName) => $"gen_ai.{providerName}.response.{parameterName}";
|
|
}
|
|
|
|
public static class System
|
|
{
|
|
public const string Message = "gen_ai.system.message";
|
|
}
|
|
|
|
public static class Token
|
|
{
|
|
public const string Type = "gen_ai.token.type";
|
|
}
|
|
|
|
public static class Tool
|
|
{
|
|
public const string Name = "gen_ai.tool.name";
|
|
public const string Description = "gen_ai.tool.description";
|
|
public const string Message = "gen_ai.tool.message";
|
|
|
|
public static class Call
|
|
{
|
|
public const string Id = "gen_ai.tool.call.id";
|
|
}
|
|
}
|
|
|
|
public static class Usage
|
|
{
|
|
public const string InputTokens = "gen_ai.usage.input_tokens";
|
|
public const string OutputTokens = "gen_ai.usage.output_tokens";
|
|
}
|
|
|
|
public static class User
|
|
{
|
|
public const string Message = "gen_ai.user.message";
|
|
}
|
|
}
|
|
|
|
public static class Server
|
|
{
|
|
public const string Address = "server.address";
|
|
public const string Port = "server.port";
|
|
}
|
|
}
|