docs(readme): 记账derived计费双保险(usage原文落库+hour/prompt_tokens_details归一)与定价YAML铁律(备选模式维度不入YAML)

This commit is contained in:
yumoqing 2026-09-07 17:32:49 +08:00
parent bf6c752a50
commit bfaa8c70c8

View File

@ -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 /