[PR #3397] [MERGED] fix(docs): fix JS overview example - import style, model string, and … #3452

Closed
opened 2026-06-05 18:23:09 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/3397
Author: @alwaysahustler
Created: 4/1/2026
Status: Merged
Merged: 4/1/2026
Merged by: @npentrel

Base: mainHead: patch-1


📝 Commits (1)

  • a772f86 fix(docs): fix JS overview example - import style, model string, and install comment

📊 Changes

1 file changed (+4 additions, -4 deletions)

View changed files

📝 src/oss/langchain/overview.mdx (+4 -4)

📄 Description

Overview

Fix three issues in the JS code block of the LangChain overview page:

  1. Non-idiomatic Zod import --import * as z from "zod" changed to import { z } from "zod". The namespace import works but is inconsistent with every other JS example in these docs.

  2. Missing provider prefix on model string --"claude-sonnet-4-6"changed to"anthropic:claude-sonnet-4-6". The bare string resolves via a silent heuristic in initChatModel (startsWith("claude") → anthropic), but the provider:model` format is what the agents page documents and what all other examples use.

  3. Malformed install comment --// First install:npm install @langchain/anthropic fixed to // First install: npm install langchain @langchain/anthropic. Added missing space after colon, and added langchain to the command — omitting it causes a runtime error on invoke().

Type of change

Type: Fix typo/bug/link/formatting

Related issues/PRs

  • GitHub issue:
  • Feature PR:

Checklist

  • I have read the contributing guidelines, including the language policy
  • I have tested my changes locally using docs dev
  • All code examples have been tested and work correctly
  • I have used root relative paths for internal links
  • [] I have updated navigation in src/docs.json if needed

Additional notes

The install comment fix is the highest-impact change - createAgent() is lazy so the missing @langchain/anthropic error only surfaces at invoke() time, which is confusing for copy-paste users.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/docs/pull/3397 **Author:** [@alwaysahustler](https://github.com/alwaysahustler) **Created:** 4/1/2026 **Status:** ✅ Merged **Merged:** 4/1/2026 **Merged by:** [@npentrel](https://github.com/npentrel) **Base:** `main` ← **Head:** `patch-1` --- ### 📝 Commits (1) - [`a772f86`](https://github.com/langchain-ai/docs/commit/a772f860676b39cb28188993af56cd5dc9979698) fix(docs): fix JS overview example - import style, model string, and install comment ### 📊 Changes **1 file changed** (+4 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/oss/langchain/overview.mdx` (+4 -4) </details> ### 📄 Description ## Overview Fix three issues in the JS code block of the LangChain overview page: 1. **Non-idiomatic Zod import** --`import * as z from "zod"` changed to `import { z } from "zod"`. The namespace import works but is inconsistent with every other JS example in these docs. 2. **Missing provider prefix on model string** --"claude-sonnet-4-6"` changed to `"anthropic:claude-sonnet-4-6"`. The bare string resolves via a silent heuristic in `initChatModel` (`startsWith("claude") → anthropic`), but the `provider:model` format is what the agents page documents and what all other examples use. 3. **Malformed install comment** --`// First install:npm install @langchain/anthropic` fixed to `// First install: npm install langchain @langchain/anthropic`. Added missing space after colon, and added `langchain` to the command — omitting it causes a runtime error on `invoke()`. ## Type of change **Type:** Fix typo/bug/link/formatting ## Related issues/PRs - GitHub issue: - Feature PR: ## Checklist - [x] I have read the contributing guidelines, including the language policy - [ ] I have tested my changes locally using `docs dev` - [x] All code examples have been tested and work correctly - [x] I have used **root relative** paths for internal links - [] I have updated navigation in `src/docs.json` if needed ## Additional notes The install comment fix is the highest-impact change - `createAgent()` is lazy so the missing `@langchain/anthropic` error only surfaces at `invoke()` time, which is confusing for copy-paste users. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 18:23:09 -04:00
yindo closed this issue 2026-06-05 18:23:09 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#3452