Skip to content

fix: migrate langchain shim imports to langchain_core - #254

Open
functionxX wants to merge 1 commit into
volcengine:mainfrom
functionxX:fix/226-langchain-prompts-import
Open

fix: migrate langchain shim imports to langchain_core#254
functionxX wants to merge 1 commit into
volcengine:mainfrom
functionxX:fix/226-langchain-prompts-import

Conversation

@functionxX

Copy link
Copy Markdown

Fixes #226

What changed

After the langchain 1.x restructure removed its re-export shims, from langchain.prompts.chat import ... / from langchain.schema... import ... break with ModuleNotFoundError: No module named 'langchain.prompts'. This migrates the affected imports to langchain_core, which is already a declared dependency (pyproject.toml) and already used elsewhere in the codebase (arkitect/core/component/llm/base.py, arkitect/core/component/output_parser/rag_output.py).

  • arkitect/core/component/prompts/custom_prompt.pylangchain.prompts.chatlangchain_core.prompts.chat, langchain.schema.messageslangchain_core.messages
  • arkitect/core/component/llm/llm.pylangchain.prompts.chatlangchain_core.prompts.chat, langchain.schema.output_parserlangchain_core.output_parsers
  • arkitect/core/component/llm/utils.pylangchain.prompts.chatlangchain_core.prompts.chat
  • demohouse/live_voice_call/backend/prompt.pylangchain.prompts.chatlangchain_core.prompts.chat

How verified

  • py_compile on all four files
  • Import smoke test after uv sync: all four modules import cleanly
  • ruff check --select I clean on the touched files (the remaining E501 warnings are pre-existing on main)

@functionxX

Copy link
Copy Markdown
Author

Hi — friendly ping on this. It fixes the langchain 1.x import crash (shim re-exports removed) across the 4 affected modules, verified with py_compile + import smoke + ruff. Would appreciate a review when you have a moment. Thanks!

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.

No module named 'langchain.prompts'

1 participant