langchain-python-quickstart
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLangChain Python quickstart
LangChain Python 快速入门
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 + ).
create_agent请遵循在线文档——不要凭记忆自行编写替代API:
获取该页面内容(通过Docs MCP或HTTP)并实现其中展示的功能(天气Agent + )。
create_agentLocal 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