langchain-models
Initialize and use LangChain chat models - includes provider selection (OpenAI, Anthropic, Google), model configuration, and invocation patterns
npx skills add majiayu000/claude-skill-registry --skill langchain-models --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# langchain-models (JavaScript/TypeScript) ## 概述 聊天模型是 LangChain 应用程序的核心。它们接收消息作为输入并返回 AI 生成的消息作为输出。LangChain 在多个提供商(OpenAI、Anthropic、Google 等)之间提供统一的接口。 **核心概念:** - **initChatModel()**:任何提供商的通用初始化 - **特定提供商的类**:直接初始化(ChatOpenAI、ChatAnthropic 等) - **消息**:结构化的输入/输出格式(HumanMessage、AIMessage 等) - **调用模式**:invoke()、stream()、batch() ## 何时使用每个提供商 | 提供商 | 最适合 | 模型 | 优势 | |----------|----------|--------|-----------| | OpenAI | 通用、推理 | GPT-4.1、GPT-5 | 强大推理、大上下文 | | Anthropic | 安全性、分析 | Claude Sonnet/Opus | 安全性、长上下文、视觉 | | Google | 多模态、速度 | Gemini 2.5 | 快速、多模态、成本效益 | | AWS Bedrock | 企业级、合规性 | 多个提供商 | 安全性、合规性、多样性 | | Azure OpenAI | 企业级 OpenAI | GPT 模型 | 企业功能、SLA | ## 决策表 ### 选择模型 | 用例 | 推荐模型 | 原因 | |----------|------------------|-----| | 复杂推理 | GPT-5、Claude Opus | 最佳逻辑能力 | | 快速响应 | Gemini Flash、GPT-4.1-mini | 低延迟 | | 视觉任务 | GPT-4.1、Claude Sonnet、Gemini | 多模态支持 | | 长上下文 | Claude Opus、Gemini | 100k+ token 窗口 | | 成本效益 | GPT-4.1-mini、Gemini Flash | 较低定价 | | 企业级/合规性 | Azure OpenAI、AWS Bedrock | 安全功能 | ### 初始化方法 | 方法 | 何时使用 | 示例 | |--------|-------------|---------| | `initChatModel("provider:model")` | 在提供商之间快速切换 | `initChatModel("openai:gpt-4.1")` | | 提供商类 | 需要特定于提供商的功能 | `new ChatOpenAI({ model:
- 概述
- 何时使用每个提供商
- 决策表
- 选择模型
- 初始化方法
- 代码示例
- 基本模型初始化
- 特定于提供商的初始化
- 简单调用
- 流式响应
- 批处理
- 多轮对话
- 模型配置选项
- Azure OpenAI
What does the langchain-models skill do?
Initialize and use LangChain chat models - includes provider selection (OpenAI, Anthropic, Google), model configuration, and invocation patterns
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill langchain-models --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
