Return type for :meth:`LLMBackend.generate_with_usage`. ``input_tokens`` / ``output_tokens`` are ``0`` when the backend can't report usage (e.g. mocks in unit tests).
| 8 | |
| 9 | @dataclass(frozen=True) |
| 10 | class LLMResult: |
| 11 | """Return type for :meth:`LLMBackend.generate_with_usage`. |
| 12 | |
| 13 | ``input_tokens`` / ``output_tokens`` are ``0`` when the backend can't |
| 14 | report usage (e.g. mocks in unit tests). |
| 15 | """ |
| 16 | |
| 17 | text: str |
| 18 | input_tokens: int = 0 |
| 19 | output_tokens: int = 0 |
| 20 | |
| 21 | |
| 22 | class LLMBackend(ABC): |
no outgoing calls