langchain-typescript-quickstart
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLangChain TypeScript quickstart
LangChain TypeScript快速入门
Follow the live docs — do not invent an alternate API from memory:
Fetch that page (Docs MCP or HTTP) and implement what it shows (weather agent + ). Requires Node 22+.
createAgent请参照实时文档操作——不要凭记忆使用替代API:
获取该页面内容(Docs MCP或HTTP方式)并实现其中展示的功能(天气Agent + )。要求Node 22及以上版本。
createAgentLocal setup constraints
本地设置约束
Apply these on top of the quickstart (they keep setup minimal and model-agnostic):
-
Ask which provider/model to use. Showcase that LangChain is model-agnostic. Suggested prompt:Which model should this agent use? Pass astring — e.g.
provider:model,openai:gpt-5.5,anthropic:claude-sonnet-5. Default if you're unsure:google-genai:gemini-2.5-flash-lite.anthropic:claude-sonnet-5Swap the quickstart's model string for their choice (or the default). -
Create a new directory (e.g.) and do all work there — do not pollute the open project.
langchain-agent/ -
Only secret: the provider API key in(gitignored). No LangSmith / Tavily unless they ask. Prefer they edit
.envthemselves — don't paste keys into chat..env -
Install the provider package needed for their model if the quickstart's base install isn't enough.
-
Run the example, show output, then stop. Point tofor next steps.
langchain-fundamentals
在快速入门的基础上遵循以下规则(这些规则确保设置极简且与模型无关):
-
询问要使用的提供商/模型。体现LangChain的模型无关性。建议提示语:该Agent应使用哪个模型?请传入格式的字符串——例如
provider:model、openai:gpt-5.5、anthropic:claude-sonnet-5。若不确定,默认选择:google-genai:gemini-2.5-flash-lite。anthropic:claude-sonnet-5将快速入门中的模型字符串替换为用户选择的(或默认的)模型。 -
创建一个新目录(例如)并在其中完成所有操作——不要污染现有项目。
langchain-agent/ -
仅需配置的密钥:文件中的提供商API密钥(已加入git忽略)。除非用户要求,否则无需配置LangSmith / Tavily。建议用户自行编辑
.env文件——不要在聊天中粘贴密钥。.env -
如果快速入门的基础安装不足以支持所选模型,安装对应提供商的包。
-
运行示例,展示输出,然后停止。如需下一步操作,请参考。
langchain-fundamentals