-
Notifications
You must be signed in to change notification settings - Fork 19.6k
Description
Checked other resources
- This is a bug, not a usage question.
- I added a clear and descriptive title that summarizes this issue.
- I used the GitHub search to find a similar question and didn't find it.
- I am sure that this is a bug in LangChain rather than my code.
- The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
- This is not related to the langchain-community package.
- I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
- I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.
Example Code
from langchain.messages import AIMessage
Error Message and Stack Trace (if applicable)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/mc/.venv-langchain-v1/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-langchain-v1/lib/python3.10/site-packages/langchain_core/messages/__init__.py)
Description
- I'm trying to import a message type from langchain.messages
System Info
System Information
OS: Linux
OS Version: #170-Ubuntu SMP Wed Oct 1 10:06:56 UTC 2025
Python Version: 3.10.12 (main, Aug 15 2025, 14:32:43) [GCC 11.4.0]
Package Information
langchain_core: 1.0.0
langchain: 1.0.3
langchain_community: 0.4
langsmith: 0.4.36
langchain_classic: 1.0.0
langchain_google_genai: 3.0.0
langchain_ollama: 1.0.0a1
langchain_openai: 1.0.1
langchain_text_splitters: 1.0.0
langgraph_sdk: 0.2.9
Optional packages not installed
langserve
Other Dependencies
aiohttp: 3.13.1
async-timeout: 4.0.3
claude-agent-sdk: Installed. No version info available.
dataclasses-json: 0.6.7
filetype: 1.2.0
google-ai-generativelanguage: 0.9.0
httpx: 0.28.1
httpx-sse: 0.4.3
jsonpatch: 1.33
langchain-anthropic: Installed. No version info available.
langchain-aws: Installed. No version info available.
langchain-deepseek: Installed. No version info available.
langchain-fireworks: Installed. No version info available.
langchain-google-vertexai: Installed. No version info available.
langchain-groq: Installed. No version info available.
langchain-huggingface: Installed. No version info available.
langchain-mistralai: Installed. No version info available.
langchain-perplexity: Installed. No version info available.
langchain-together: Installed. No version info available.
langchain-xai: Installed. No version info available.
langgraph: 1.0.2
langsmith-pyo3: Installed. No version info available.
numpy: 2.2.6
ollama: 0.6.0
openai: 2.6.0
openai-agents: Installed. No version info available.
opentelemetry-api: Installed. No version info available.
opentelemetry-exporter-otlp-proto-http: Installed. No version info available.
opentelemetry-sdk: Installed. No version info available.
orjson: 3.11.3
packaging: 25.0
pydantic: 2.12.2
pydantic-settings: 2.11.0
pytest: Installed. No version info available.
PyYAML: 6.0.3
pyyaml: 6.0.3
requests: 2.32.5
requests-toolbelt: 1.0.0
rich: Installed. No version info available.
SQLAlchemy: 2.0.44
sqlalchemy: 2.0.44
tenacity: 9.1.2
tiktoken: 0.12.0
typing-extensions: 4.15.0
vcrpy: Installed. No version info available.
zstandard: 0.25.0