| 27 | |
| 28 | @dataclass(frozen=True) |
| 29 | class UsageSummary: |
| 30 | input_tokens: int = 0 |
| 31 | output_tokens: int = 0 |
| 32 | |
| 33 | def add_turn(self, prompt: str, output: str) -> 'UsageSummary': |
| 34 | return UsageSummary( |
| 35 | input_tokens=self.input_tokens + len(prompt.split()), |
| 36 | output_tokens=self.output_tokens + len(output.split()), |
| 37 | ) |
| 38 | |
| 39 | |
| 40 | @dataclass |
no outgoing calls
no test coverage detected