From bfaa8c70c81de5c1618b7f1218c05c80d7e4e69f Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 7 Sep 2026 17:32:49 +0800 Subject: [PATCH] =?UTF-8?q?docs(readme):=20=E8=AE=B0=E8=B4=A6derived?= =?UTF-8?q?=E8=AE=A1=E8=B4=B9=E5=8F=8C=E4=BF=9D=E9=99=A9(usage=E5=8E=9F?= =?UTF-8?q?=E6=96=87=E8=90=BD=E5=BA=93+hour/prompt=5Ftokens=5Fdetails?= =?UTF-8?q?=E5=BD=92=E4=B8=80)=E4=B8=8E=E5=AE=9A=E4=BB=B7YAML=E9=93=81?= =?UTF-8?q?=E5=BE=8B(=E5=A4=87=E9=80=89=E6=A8=A1=E5=BC=8F=E7=BB=B4?= =?UTF-8?q?=E5=BA=A6=E4=B8=8D=E5=85=A5YAML)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 20b5c7c..7f471a4 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,14 @@ 均可,Jinja `is string` 动态判断),变长输入用 `{% for %}` 按文档示例组装。 - **异步模型执行器**:sync_mode=async 时走提交→按 query_profile_ids 轮询→ 取结果;等待预算默认 600 秒,`_timeout` 可覆盖(上限 900)。 +- **记账 derived 计费双保险(2026-09-07 根治 qwen3.8-max 记账 failed)**: + ① `inference.py` 同步路径把模型返回的 usage 原文落 `llm_usage.usages`(对齐异步路径与 + sage/llmage 范式)——定价 YAML 的 derived 变量引用(`prompt_tokens_details.cached_tokens`) + 依赖原始结构,此前同步路径丢弃 usages 导致 uncache_tokens 兜底成 0、输入 token 永不计费; + ② `accounting.py` `_settle_one` 出账时对缺失的 `prompt_tokens_details` 补 `{'cached_tokens': 0}`, + 并按 `created_at` 注入 `hour` 维度(忙闲时分档计价用,如 deepseek-v4-pro-0813)。 + 定价 YAML 铁律:定价项顶层只放运行时必带的维度,Batch/显式缓存/限时折扣等备选模式绝不入 + YAML(缺失键会炸整个方案)——详见 pricing-data-format 技能 §14-16。 - **会话 agent 模型选择收窄为对话能力(2026-09-06 用户定夺)**: `selection.CHAT_CAPS = ('t2t','i2t','m2t')` 是会话形态能力白名单的**唯一事实源**—— 所有会话 agent 模型下拉(agent_model_options / cockpit_model_options /