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/utilsgit clone --depth 1 https://github.com/xt765/LangChain-Chinese-CommentWhat 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.00396 |
| Opus 5 | $0.00000 | $0.00198 |
| Sonnet 5 | $0.00000 | $0.00079 |
| Haiku 4.5 | $0.00000 | $0.00040 |
Grade A, and why
utils 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 2d 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\utils.py
此文档提供了 libs\langchain\langchain_classic\agents\utils.py 文件的详细中文注释。该模块包含代理模块中使用的实用工具函数。
功能描述
该模块目前主要负责对代理所使用的工具进行兼容性检查。
核心函数:validate_tools_single_input
该函数用于验证提供给代理的工具列表是否符合“单输入”限制。
1. 背景说明
许多经典的代理(如 ZeroShotAgent)设计时仅能处理简单的字符串输入。如果将需要复杂 JSON 或多个参数的工具分配给这些代理,会导致运行失败。该函数提供了一种前置校验机制。
2. 函数逻辑
def validate_tools_single_input(class_name: str, tools: Sequence[BaseTool]) -> None:
for tool in tools:
if not tool.is_single_input:
msg = f"{class_name} does not support multi-input tool {tool.name}."
raise ValueError(msg)
- 参数:
class_name: 调用方的类名,用于生成清晰的错误消息。tools: 待检查的工具列表。
- 行为: 遍历所有工具,若发现任一工具的
is_single_input为False,则抛出ValueError。
使用场景
通常在代理类的 from_llm_and_tools 或 __init__ 方法中调用。例如,ZeroShotAgent 会使用它来确保它能正确地将输入传递给工具。
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.
- 2d ago First seen · 36 lines · 0 tokens per session scan A 885a74b28039
utils 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 396 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
milestone-planner
Use when you say "break this epic into milestones", "plan this roadmap item", or hand it a roadmap epic. Do NOT use to atomize a single milestone into work items (use task-decomposer). High-rigor planning assistant who translates roadmap epics into implementation-ready work packages with clear milestones…
deployment-specialist
部署操作领域的专家.
alert-analyzer
分析系统健康状态和告警.
incident-commander
管理事件响应流程.
API-documenter
创建全面的 API 文档.
code-commentator
改进代码文档质量.