Skip to content

fix(langchain): various JS import fixes#910

Merged
Eugene Yurtsev (eyurtsev) merged 1 commit into
mainfrom
cb/fix-imports
Oct 15, 2025
Merged

fix(langchain): various JS import fixes#910
Eugene Yurtsev (eyurtsev) merged 1 commit into
mainfrom
cb/fix-imports

Conversation

@christian-bromann

Copy link
Copy Markdown
Member

Various JS import fixes.

Copilot AI review requested due to automatic review settings October 15, 2025 13:10
@github-actions github-actions Bot added langchain For docs changes to LangChain langsmith For docs changes to LangSmith oss javascript labels Oct 15, 2025
@github-actions

Copy link
Copy Markdown
Contributor

Preview ID generated: preview-cbfixi-1760533885-3d884ad

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Copilot AI Oct 15, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Copilot uses AI. Check for mistakes.
@eyurtsev
Eugene Yurtsev (eyurtsev) merged commit fd6609b into main Oct 15, 2025
11 checks passed
@eyurtsev
Eugene Yurtsev (eyurtsev) deleted the cb/fix-imports branch October 15, 2025 18:57
Jeongsk (jeongsk) pushed a commit to jeongsk/langchain-docs that referenced this pull request Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript langchain For docs changes to LangChain langsmith For docs changes to LangSmith oss

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants