fix(langchain): various JS import fixes#910
Merged
Merged
Conversation
Christian Bromann (christian-bromann)
requested review from
Kathryn May (katmayb) and
Lauren Hirata Singh (lnhsingh)
as code owners
October 15, 2025 13:10
Contributor
|
Preview ID generated: preview-cbfixi-1760533885-3d884ad |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates JavaScript/TypeScript import paths in documentation examples to align with current LangChain v1 exports and package structure.
- Switches various imports to top-level "langchain" where available.
- Moves classic components to "@langchain/classic/*" paths.
- Normalizes examples across docs (e.g., initChatModel, SqlDatabase, MemoryVectorStore).
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/oss/langchain/sql-agent.mdx | Updates SqlDatabase imports to @langchain/classic/sql_db in code examples. |
| src/oss/langchain/quickstart.mdx | Consolidates initChatModel into top-level langchain import. |
| src/oss/langchain/middleware.mdx | Updates middleware imports to top-level langchain; adjusts example middleware reference. |
| src/oss/langchain/human-in-the-loop.mdx | Moves humanInTheLoopMiddleware to top-level import. |
| src/oss/langchain/agents.mdx | Moves dynamicSystemPromptMiddleware to top-level import. |
| src/oss/javascript/migrate/langchain-v1.mdx | Migration guide reflects top-level createAgent import. |
| src/langsmith/rate-limiting.mdx | Simplifies initChatModel import to top-level langchain. |
| src/langsmith/evaluate-rag-tutorial.mdx | Updates MemoryVectorStore import to @langchain/classic/vectorstores/memory. |
| @@ -175,7 +175,7 @@ sql_db_query_checker: Use this tool to double check if your query is correct bef | |||
|
|
|||
| Use the `SqlDatabase` wrapper available in the `langchain/sql_db` to interact with the database. The wrapper provides a simple interface to execute SQL queries and fetch results: | |||
There was a problem hiding this comment.
The prose references the old import path langchain/sql_db, but the example correctly imports from @langchain/classic/sql_db. Update the text to reflect the correct package, e.g., “available in @langchain/classic/sql_db,” or rephrase to avoid hard-coding the path.
Suggested change
| Use the `SqlDatabase` wrapper available in the `langchain/sql_db` to interact with the database. The wrapper provides a simple interface to execute SQL queries and fetch results: | |
| Use the `SqlDatabase` wrapper available in `@langchain/classic/sql_db` to interact with the database. The wrapper provides a simple interface to execute SQL queries and fetch results: |
Eugene Yurtsev (eyurtsev)
approved these changes
Oct 15, 2025
Jeongsk (jeongsk)
pushed a commit
to jeongsk/langchain-docs
that referenced
this pull request
Oct 17, 2025
Various JS import fixes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Various JS import fixes.