(state: StreamState)
| 829 | } |
| 830 | |
| 831 | function computeUsage(state: StreamState) { |
| 832 | const completion_tokens = state.outputTokens; |
| 833 | const total_tokens = state.totalTokens || completion_tokens; |
| 834 | const prompt_tokens = Math.max(0, total_tokens - completion_tokens); |
| 835 | return { prompt_tokens, completion_tokens, total_tokens }; |
| 836 | } |
| 837 | |
| 838 | function processServerMessage( |
| 839 | msg: AgentServerMessage, |
no outgoing calls
no test coverage detected