(value: Any)
| 292 | |
| 293 | |
| 294 | def _token_count(value: Any) -> int: |
| 295 | if isinstance(value, bool): |
| 296 | return 0 |
| 297 | if isinstance(value, int): |
| 298 | return value |
| 299 | if isinstance(value, float) and value.is_integer(): |
| 300 | return int(value) |
| 301 | if isinstance(value, str): |
| 302 | try: |
| 303 | return int(value) |
| 304 | except ValueError: |
| 305 | return 0 |
| 306 | return 0 |
| 307 | |
| 308 | |
| 309 | def _opencode_usage_tokens(tokens: dict[str, Any]) -> tuple[int, int]: |
no outgoing calls
no test coverage detected