Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/xt765/langchain-chinese-comment/__init__git clone --depth 1 https://github.com/xt765/LangChain-Chinese-CommentWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/xt765/langchain-chinese-comment/__init__)<a href="https://agentmods.dev/agents/xt765/langchain-chinese-comment/__init__"><img src="https://agentmods.dev/badge/agents/xt765/langchain-chinese-comment/__init__.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.00719 |
| Opus 5 | $0.00000 | $0.00360 |
| Sonnet 5 | $0.00000 | $0.00144 |
| Haiku 4.5 | $0.00000 | $0.00072 |
Grade A, and why
__init__ scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
libs\langchain\langchain_classic\agents_init_.py
此文档提供了 libs\langchain\langchain_classic\agents\__init__.py 文件的详细中文注释。该模块是 LangChain 代理系统的核心入口。
功能描述
代理 (Agent) 是一种使用大语言模型(LLM)来选择一系列动作执行的类。在链(Chains)中,动作序列是硬编码的;而在代理中,语言模型被用作推理引擎,来决定采取哪些动作以及以何种顺序执行。
代理会选择并使用 工具 (Tools) 和 工具包 (Toolkits) 来执行动作。
主要组件
该模块聚合并导出了代理框架的核心类和函数:
1. 核心抽象与执行器
BaseSingleActionAgent,BaseMultiActionAgent: 代理的基础抽象类。Agent: 传统的基于LLMChain的代理基类。AgentExecutor: 代理执行器,负责驱动代理的思考-行动-观察循环。AgentExecutorIterator: 允许迭代执行代理步骤的工具。AgentOutputParser: 将 LLM 输出解析为代理动作或结束状态的解析器。
2. 预置代理类型与创建函数
AgentType: 代理类型的枚举。create_react_agent: 创建 ReAct 风格的代理。create_openai_functions_agent,create_openai_tools_agent: 利用 OpenAI 特定能力的代理。create_structured_chat_agent: 适用于聊天模型的结构化代理。create_xml_agent: 专门生成 XML 格式的代理。create_tool_calling_agent: 通用的工具调用代理。create_self_ask_with_search_agent: 自我提问搜索代理。
3. 加载与初始化
initialize_agent: (已弃用) 快速初始化代理的函数。load_agent: 从配置文件或仓库加载代理。
动态导入与弃用处理
该模块使用了动态导入机制来处理已迁移到 langchain_community 或 langchain_experimental 的组件。
1. 迁移至 langchain_community
以下组件通过 DEPRECATED_LOOKUP 动态映射到社区包:
load_tools,load_huggingface_tool,get_all_tool_namescreate_json_agent,create_openapi_agent,create_pbi_agent,create_pbi_chat_agent,create_spark_sql_agent,create_sql_agent
2. 迁移至 langchain_experimental
以下代理创建函数已迁移到实验性包,直接调用会抛出 ImportError:
create_csv_agent,create_pandas_dataframe_agent,create_spark_dataframe_agent,create_xorbits_agent
迁移建议
对于新的代理开发,建议参考 LangGraph 文档。LangGraph 提供了比传统 AgentExecutor 更灵活、功能更强大的框架,支持循环逻辑、状态持久化和复杂的人机交互模式。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 53 lines · 0 tokens per session scan A 61a212339db1
__init__ is an agent published in the GitHub repository xt765/LangChain-Chinese-Comment (20 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 719 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
verify-agent
구현 완료 후 fresh-context 검증 전용. typecheck → lint → build → test 파이프라인 독립 실행. 단순 에러(import·타입) 자동 수정, 비수정 가능 에러 분류 보고. Use proactively — 비단순 코드 변경 완료 직후 사람 호출("검증해줘"·"빌드 확인")을 기다리지 말고 자율 spawn한다. 완료 주장 전 필수(verification.md 자율 검증 §11). 사람 발화에 의존하지 않는다. /handoff-verify 스킬에서도 자동 스폰. 구현 자체는 tdd-guide나 impl-worker 사용.
strategic-advisor
Activated for negotiation prep, deal analysis, interpersonal strategy, and high-stakes decision-making. Combines game theory with psychological awareness.
integration-reviewer
Runtime integration validator — read-only. Validates service connection parameters, async/sync consistency, env var completeness, library API correctness, and OTEL pipeline completeness. Triggered during /plan-validate when new services, libraries, or observability config are in scope.
ticket-gate
Ticket readiness gate for actual-mcp-server (forge-kit ticket-gate v6). Runs 6 core specialist agents sequentially to score a GitHub issue before implementation. Each agent scores 1-10; ALL must score 10 to pass. An agent whose domain the ticket does not touch auto-scores 10 (N/A). Extra specialists are added by…
code-simplifier
Use this agent when code has been written or modified and needs to be simplified for clarity, consistency, and maintainability while preserving all functionality. This agent should be triggered automatically after completing a coding task or writing a logical chunk of code. It simplifies code by following project best…
agent-registry-auditor
Audits agents for DIP-0016 compliance and registry alignment. Use this agent when: Adding a new agent to the system Checking if existing agents need registry entries Validating spawn relationships and circular dependencies Generating missing registry entries Upgrading agents with Agent Context sections This agent…