Skip to content

Commit ec62de1

Browse files
fix: add latest GenAI semantic convention attributes
1 parent b80f109 commit ec62de1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ class SpanAttributes:
156156
LLM_REQUEST_TOP_P = "gen_ai.request.top_p"
157157
LLM_PROMPTS = "gen_ai.prompt"
158158
LLM_COMPLETIONS = "gen_ai.completion"
159+
GEN_AI_INPUT_MESSAGES = "gen_ai.input.messages"
160+
GEN_AI_OUTPUT_MESSAGES = "gen_ai.output.messages"
161+
GEN_AI_SYSTEM_INSTRUCTIONS = "gen_ai.system_instructions"
159162
LLM_RESPONSE_MODEL = "gen_ai.response.model"
160163
LLM_USAGE_COMPLETION_TOKENS = "gen_ai.usage.completion_tokens"
161164
LLM_USAGE_PROMPT_TOKENS = "gen_ai.usage.prompt_tokens"

packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/_testing.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ class TestSpanAttributesLegacyLLMNamesPresent:
9797
("LLM_REQUEST_TEMPERATURE", "gen_ai.request.temperature"),
9898
("LLM_REQUEST_TOP_P", "gen_ai.request.top_p"),
9999
("LLM_PROMPTS", "gen_ai.prompt"),
100+
("GEN_AI_INPUT_MESSAGES", "gen_ai.input.messages"),
101+
("GEN_AI_OUTPUT_MESSAGES", "gen_ai.output.messages"),
102+
("GEN_AI_SYSTEM_INSTRUCTIONS", "gen_ai.system_instructions"),
100103
("LLM_COMPLETIONS", "gen_ai.completion"),
101104
("LLM_RESPONSE_MODEL", "gen_ai.response.model"),
102105
("LLM_USAGE_COMPLETION_TOKENS", "gen_ai.usage.completion_tokens"),

0 commit comments

Comments
 (0)