词元之母TOK.MOM - 平台充值汇率 1:1 即 1 人民币充值到账 1 美元,支持一个 Key 调用近 600+ 海内外模型,限时特价模型低至 1 折,欢迎上岸!
@ 后跟一个引用,即可将内容直接注入消息。Hermes 会将引用内联展开,并在 --- Attached Context --- 区块下追加相应内容。| 语法 | 说明 |
|---|---|
@file:path/to/file.py | 注入文件内容 |
@file:path/to/file.py:10-25 | 注入指定行范围(从 1 开始,含首尾) |
@folder:path/to/dir | 注入目录树列表及文件元数据 |
@diff | 注入 git diff(未暂存的工作区变更) |
@staged | 注入 git diff --staged(已暂存的变更) |
@git:5 | 注入最近 N 次提交及补丁(最多 10 次) |
@url:https://example.com | 抓取并注入网页内容 |
Review @file:src/main.py and suggest improvements
What changed? @diff
Compare @file:old_config.yaml and @file:new_config.yaml
What's in @folder:src/components?
Summarize this article @url:https://arxiv.org/abs/2301.00001Check @file:main.py, and also @file:test.py.,、.、;、!、?)会被自动去除。@ 会触发自动补全:@ 显示所有引用类型(@diff、@staged、@file:、@folder:、@git:、@url:)@file: 和 @folder: 触发文件系统路径补全,并显示文件大小元数据@ 后跟部分文本时,显示当前目录中匹配的文件和文件夹@file: 引用支持行范围,用于精确注入内容:@file:src/main.py:42 # 单行第 42 行
@file:src/main.py:10-25 # 第 10 至 25 行(含首尾)| 阈值 | 值 | 行为 |
|---|---|---|
| 软限制 | 上下文长度的 25% | 追加警告,继续展开 |
| 硬限制 | 上下文长度的 50% | 拒绝展开,返回原始消息不变 |
| 文件夹条目 | 最多 200 个文件 | 超出部分替换为 - ... |
| Git 提交数 | 最多 10 次 | @git:N 限制在 [1, 10] 范围内 |
@file: 引用拦截,以防止凭据泄露:~/.ssh/id_rsa、~/.ssh/id_ed25519、~/.ssh/authorized_keys、~/.ssh/config~/.bashrc、~/.zshrc、~/.profile、~/.bash_profile、~/.zprofile~/.netrc、~/.pgpass、~/.npmrc、~/.pypirc$HERMES_HOME/.env~/.ssh/、~/.aws/、~/.gnupg/、~/.kube/、$HERMES_HOME/skills/.hub/.py、.md、.json、.yaml、.toml、.js、.ts 等)会跳过基于 MIME 的检测。二进制文件将被拒绝并附带警告。@ 触发 tab 补全,引用在消息发送给 agent 之前完成展开。@ 语法不会被 gateway 展开——消息原样透传。agent 本身仍可通过 read_file、search_files 和 web_extract 工具引用文件。@file: 注入的大文件内容会占用 context 用量@file:main.py:100-200)仅注入相关片段# 代码审查工作流
Review @diff and check for security issues
# 带上下文的调试
This test is failing. Here's the test @file:tests/test_auth.py
and the implementation @file:src/auth.py:50-80
# 项目探索
What does this project do? @folder:src @file:README.md
# 研究
Compare the approaches in @url:https://arxiv.org/abs/2301.00001
and @url:https://arxiv.org/abs/2301.00002| 条件 | 行为 |
|---|---|
| 文件未找到 | 警告:"file not found" |
| 二进制文件 |