Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mcavdar
Copy link

@mcavdar mcavdar commented Nov 1, 2025

Description: langchain 1.0.3 requires langchain-core>=1.0.2, PR updated the dependency.
Issue: Fixes #33770

@github-actions github-actions bot added langchain Related to the package `langchain` dependencies Pull requests that update a dependency file v1 Issue specific to LangChain 1.0 fix labels Nov 1, 2025
@eyurtsev
Copy link
Collaborator

eyurtsev commented Nov 3, 2025

Hmm I don't think this should be required. Could you confirm what happens if you have langchain 1.0.3 and langchain_core 1.0? I'm wondering if maybe langchain_core was a different version?

@eyurtsev eyurtsev self-assigned this Nov 3, 2025
@mcavdar
Copy link
Author

mcavdar commented Nov 3, 2025

hi @eyurtsev

what happens if you have langchain 1.0.3 and langchain_core 1.0?

I assume you meant langchain 1.0.3 and langchain_core 1.0.0. Here’s my test setup in a clean environment:

pip install langchain_core===1.0.0
pip install -U langchain

I’m still seeing the same issue: #33770

>>> from langchain.messages import AIMessage
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/mc/.venv-langchaing_test/lib/python3.10/site-packages/langchain/messages/__init__.py", line 12, in <module>
    from langchain_core.messages import (
ImportError: cannot import name 'InputTokenDetails' from 'langchain_core.messages' (/home/mc/.venv-langchaing_test/lib/python3.10/site-packages/langchain_core/messages/__init__.py)
$ pip freeze
...
langchain==1.0.3
langchain-core==1.0.0
...

Is this expected behavior? I have version 1.0.0 installed(both), and when I try to update langchain, it doesn’t update langchain_core:

pip install langchain_core===1.0.0
pip install langchain===1.0.0
pip install -U langchain
$ pip freeze
...
langchain==1.0.3
langchain-core==1.0.0
...

@github-actions github-actions bot added fix and removed fix labels Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file fix langchain Related to the package `langchain` v1 Issue specific to LangChain 1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cannot import AIMessage from langchain.messages

2 participants