mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-22 06:02:00 +00:00
模型不在价格目录里时运行金额写「金额无法估算」,不写 $0:真实运行里 token 记到了上百万,金额却是 $0,看着像没花钱。llm.end 发出时,用了 token、模型却不在价格目录里的标 unpriced(目录里标 0 价的本地模型不算);运行用量按 llm.end 数出 unpriced_calls,成功的运行也补上(状态里的用量分不出 0 是免费还是没价)。运行详情、画布运行面板、航迹的金额:一分都没估出来写「金额无法估算」,估出一部分写「≥ $x」,悬停说几次调用不在价格目录中。check-trace 补断言;流式用量测试和注释里的真实调用次数换成概括说法
This commit is contained in:
@@ -56,6 +56,12 @@ class NodeContext:
|
||||
writer = get_stream_writer()
|
||||
except Exception: # noqa: BLE001 - 不在图执行上下文里(比如单元测试)
|
||||
return
|
||||
if str(event_type) == EventType.LLM_END and "unpriced" not in data:
|
||||
from app.providers.catalog import unpriced_call
|
||||
|
||||
if unpriced_call(data):
|
||||
# 金额估不出来(模型不在价格目录里):标出来,界面不把它的 0 当成「没花钱」
|
||||
data = {**data, "unpriced": True}
|
||||
writer(
|
||||
{
|
||||
"__agentlab__": True,
|
||||
|
||||
Reference in New Issue
Block a user