Replies: 1 comment
-
👍,可以。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
目标
实现一个 token 计算工具,用于展示/记录模型调用中的 token 消耗。
方案概述
实现一个内部 token 计算模块,支持以下两处输出:
关键设计
token 计算
token 计算方式基于目前使用的 ai-sdk 提供的 usage 能力
Terminal 提示
取名为 Generation ID,原因如下图
日志格式
用 session plugin 来做,用 query hook
加入 generations 的结构,记录每次对话的 token usage
Beta Was this translation helpful? Give feedback.
All reactions