跳到主要内容

examples

核对日期:2026-05-18
说明:示例源码位于 ../src/examples/,通过 npm run examples 一次性运行。

文件学习点
01-chat-model.tsChat model 与 messages
02-tools.tszod schema、工具权限、校验失败
03-agent-dynamic-tools.tsAgent loop 与动态工具选择
04-structured-output.tsStructured output 和解析
05-memory.tscheckpointer 与 long-term store
06-rag.tsRetrieval、ACL、citation
07-streaming-runtime-guardrails.tsmiddleware、runtime、guardrails、streaming

官方资料:https://docs.langchain.com/oss/javascript/langchain/overview