SessionUsage builds a Usage from the session's current token counts, the model's context limit, and the session's own cost.
(sess *session.Session, contextLimit int64)
| 397 | // SessionUsage builds a Usage from the session's current token counts, the |
| 398 | // model's context limit, and the session's own cost. |
| 399 | func SessionUsage(sess *session.Session, contextLimit int64) *Usage { |
| 400 | return &Usage{ |
| 401 | InputTokens: sess.InputTokens, |
| 402 | OutputTokens: sess.OutputTokens, |
| 403 | ContextLength: sess.InputTokens + sess.OutputTokens, |
| 404 | ContextLimit: contextLimit, |
| 405 | Cost: sess.OwnCost(), |
| 406 | } |
| 407 | } |
| 408 | |
| 409 | type SessionTitleEvent struct { |
| 410 | AgentContext |
no test coverage detected