Skip to content

docs: add the runnable LangChain docs example - #41

Merged
gjwang merged 1 commit into
mainfrom
docs/langchain-first-read-20261107
Nov 7, 2026
Merged

gjwang merged 1 commit into
mainfrom
docs/langchain-first-read-20261107

Conversation

@gjwang

@gjwang gjwang commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

将已实测、已公开的 LangChain 文档首读示例整理为可直接运行的 examples/langchain_docs.py,补齐英中 README 与 Agent 任务入口。读者通过 uv 直接运行,无需复制展示帖代码或准备模型、钱包、账户 key。

脚本只在原公开代码前增加 PEP 723 依赖声明,固定当前 langchain[mcp]1.4.9 / FastMCP4.1.6 / MCP2.3.0;保持普通 UA 默认、显式内部 QA 标记以及 beta 提示。README 命令关闭 LangSmith tracing。

验证:

  • 新脚本与已公开版本完整 AST 相同,与原真实四次HTTP200观测的全部函数 AST 相同;新增元数据 TOML 可解析、Python 语法有效。
  • 复用原 native0/两工具成功与公开 UA 分支检查;本次未重新安装依赖或发送产品请求,不冒新现场验收。
  • 仅四文件,英中命令及范围一致,diff-check通过。

验收项: README 与 AGENTS 能直接定位运行文件;脚本依赖、beta及无模型首读边界清楚,不改现有示例与 TypeScript 路径。

Follow-up validation at 2026-11-07 16:19 UTC: downloaded the exact merged examples/langchain_docs.py from f6199662a459abebccba5c3451d80bf5e9a199e4 (SHA256 d0bc55c7698c166c8d859fc60c59bf5c264858d40b18cf49c4fc49e699baab18) into a fresh task directory and empty task-local uv cache. uv run --script --python 3.11 examples/langchain_docs.py completed with Python 3.11.14 and native exit 0: PEP 723 installed 86 packages, protocol 2026-07-28, exactly search_docs/read_doc, both successful, with the expected Quickstart result and non-empty document. The langchain.mcp beta warning remained visible. Total dependency setup plus execution was 5.76 seconds for this one run, not a performance benchmark.

The run used BLOCKVECTRA_INTERNAL_QA=1 and LANGSMITH_TRACING=false, no model, account, API key or chain RPC. It is internal first-use QA, not customer adoption. HTTP counts were not traced and are unknown; no four-request count is inferred from the earlier SDK run. Top-level dependency pins are not a complete transitive lock. The task environment was removed after retaining the resolved package list and raw output; no source or published file was changed.

@gjwang
gjwang merged commit f619966 into main Nov 7, 2026
1 check passed
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.

1 participant