fix(semconv): add latest GenAI semantic convention attributes#3990
Conversation
📝 WalkthroughWalkthroughThis PR adds three new legacy Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py (1)
159-161: Consider moving theseGEN_AI_*constants out of the legacy alias block.Line 159-Line 161 are canonical
GEN_AI_*names, but they currently live underLegacy LLM_* aliases. Keeping true legacy aliases and canonical constants in separate sections will make future deprecation/migration cleanup less error-prone.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py` around lines 159 - 161, The three canonical constants GEN_AI_INPUT_MESSAGES, GEN_AI_OUTPUT_MESSAGES, and GEN_AI_SYSTEM_INSTRUCTIONS are currently placed inside the "Legacy LLM_* aliases" block; move these canonical GEN_AI_* definitions out of that legacy section into the main canonical constants area (or create a separate "Canonical GEN_AI constants" section) so canonical names are clearly separated from legacy aliases, while keeping any LLM_* alias assignments below (or referencing the moved constants) to preserve backward-compatible aliases.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py`:
- Around line 159-161: The three canonical constants GEN_AI_INPUT_MESSAGES,
GEN_AI_OUTPUT_MESSAGES, and GEN_AI_SYSTEM_INSTRUCTIONS are currently placed
inside the "Legacy LLM_* aliases" block; move these canonical GEN_AI_*
definitions out of that legacy section into the main canonical constants area
(or create a separate "Canonical GEN_AI constants" section) so canonical names
are clearly separated from legacy aliases, while keeping any LLM_* alias
assignments below (or referencing the moved constants) to preserve
backward-compatible aliases.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d66b5513-eab7-44ad-a787-3acc10217c21
📒 Files selected for processing (2)
packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.pypackages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/_testing.py
feat(instrumentation): ...orfix(instrumentation): ....Fixes #3515.
Adds constants for the latest OpenTelemetry GenAI message attributes:
The existing gen_ai.prompt and gen_ai.completion constants are preserved for backward compatibility.
Tests updated in opentelemetry-semantic-conventions-ai/_testing.py.
Tested locally:
245 passed in 0.23s
Summary by CodeRabbit
gen_ai.input.messages,gen_ai.output.messages, andgen_ai.system_instructions.