Skip to content

Conversation

hefeng6500
Copy link

No description provided.

@github-actions github-actions bot added langchain For docs changes to LangChain oss labels Sep 24, 2025
@hntrl
Copy link
Member

hntrl commented Sep 24, 2025

Hey @hefeng6500!

This is intended actually -- we're thinking it's better for the end user if you're importing everything you need from one package. The only time you would need to import these from core is when you're writing integrations to avoid the dependency bloat.

In light of that, going to close this.

@hntrl hntrl closed this Sep 24, 2025
@hefeng6500
Copy link
Author

Hey @hefeng6500!

This is intended actually -- we're thinking it's better for the end user if you're importing everything you need from one package. The only time you would need to import these from core is when you're writing integrations to avoid the dependency bloat.

In light of that, going to close this.

Hi @hntrl, thanks for the review and for keeping imports minimal for end users.
However, when I run this code on langchain v1.0.0a9, I get the following error.

from langchain.messages import HumanMessage, AIMessage, SystemMessage

I get the following error:

ModuleNotFoundError: No module named 'langchain.messages'

It only works when I use:

from langchain_core.messages import HumanMessage, AIMessage, SystemMessage

Could you confirm the correct import path for the docs examples? Otherwise, users following the documentation will run into the same error.

@hntrl
Copy link
Member

hntrl commented Sep 26, 2025

apologies, this was a miscomm on my part! We're currently working on adding these to langchain

cc @sydney-runkle @eyurtsev

@mcavdar
Copy link

mcavdar commented Sep 29, 2025

Hi @hntrl ,
I was about to open a PR for the same issue but noticed this one already exists.
Are contributions still welcome? Would it be possible to consider reopening this PR and merging it?

@hntrl
Copy link
Member

hntrl commented Sep 29, 2025

@mcavdar @hefeng6500 We can reopen this and merge, then when langchain.messages becomes available we'll swap it over. Thanks!

@hntrl hntrl enabled auto-merge (squash) September 29, 2025 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
langchain For docs changes to LangChain oss
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants