Skip to content

fix(langchain): bump semconv-ai min requirement to 0.4.14 to fix GenAICustomOperationName ImportError#3794

Open
NIK-TIGER-BILL wants to merge 1 commit intotraceloop:mainfrom
NIK-TIGER-BILL:fix/langchain-semconv-min-version-for-genai-custom-op
Open

fix(langchain): bump semconv-ai min requirement to 0.4.14 to fix GenAICustomOperationName ImportError#3794
NIK-TIGER-BILL wants to merge 1 commit intotraceloop:mainfrom
NIK-TIGER-BILL:fix/langchain-semconv-min-version-for-genai-custom-op

Conversation

@NIK-TIGER-BILL
Copy link

@NIK-TIGER-BILL NIK-TIGER-BILL commented Mar 11, 2026

Problem

opentelemetry-instrumentation-langchain 0.53.0 imports GenAICustomOperationName from opentelemetry.semconv_ai (added in version 0.4.14). The minimum requirement in pyproject.toml was still >=0.4.13, so users who had exactly 0.4.13 installed got an ImportError on startup (closes #3766):

ImportError: cannot import name 'GenAICustomOperationName'
from 'opentelemetry.semconv_ai'

Fix

Bump the lower bound from >=0.4.13 to >=0.4.14:

"opentelemetry-semantic-conventions-ai>=0.4.14,<0.5.0",

GenAICustomOperationName was introduced in semconv-ai 0.4.14 (commit f687ca1). This is a minimal, non-breaking change — 0.4.14 is already published on PyPI.

Closes #3766

Summary by CodeRabbit

  • Chores
    • Updated OpenTelemetry semantic conventions for AI dependency to the latest patch version.

…ICustomOperationName ImportError

opentelemetry-instrumentation-langchain 0.53.0 imports GenAICustomOperationName
from opentelemetry.semconv_ai (added in commit f687ca1 / version 0.4.14).
The minimum requirement was still >=0.4.13, so users who had exactly 0.4.13
installed got:

  ImportError: cannot import name 'GenAICustomOperationName'
  from 'opentelemetry.semconv_ai'

Fix: bump the lower bound to >=0.4.14 where GenAICustomOperationName exists.

Closes traceloop#3766
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ad178d94-bae7-4906-8618-821559439303

📥 Commits

Reviewing files that changed from the base of the PR and between 93786d9 and 3f10d56.

📒 Files selected for processing (1)
  • packages/opentelemetry-instrumentation-langchain/pyproject.toml

📝 Walkthrough

Walkthrough

This change bumps the opentelemetry-semantic-conventions-ai dependency from version >=0.4.13,<0.5.0 to >=0.4.14,<0.5.0 in the pyproject.toml file, addressing an import compatibility issue with the GenAICustomOperationName symbol.

Changes

Cohort / File(s) Summary
Dependency Version Bump
packages/opentelemetry-instrumentation-langchain/pyproject.toml
Updated opentelemetry-semantic-conventions-ai from >=0.4.13,<0.5.0 to >=0.4.14,<0.5.0 to resolve ImportError for GenAICustomOperationName.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A carrot of versions, so shiny and new,
GenAICustomOperationName is finally true,
From 0.4.13 to 0.4.14 we hop,
No more ImportError, our troubles just stop! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: bumping the semconv-ai minimum requirement to 0.4.14 to fix a GenAICustomOperationName ImportError.
Linked Issues check ✅ Passed The PR directly addresses issue #3766 by bumping opentelemetry-semantic-conventions-ai from >=0.4.13 to >=0.4.14, which resolves the ImportError for GenAICustomOperationName and meets all stated coding objectives.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the ImportError in issue #3766; only the semconv-ai version constraint was modified with no unrelated alterations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dxiang-ui
Copy link

"Bump the lower bound from >=0.4.13 to >=0.4.14" didn't fix the import error for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Bug Report: ImportError GenAICustomOperationName after upgrading to otel langchain 0.53.0

3 participants