(input_tokens: int, output_tokens: int)
| 442 | pending_tools: list[str] = [] |
| 443 | |
| 444 | def _close_step(input_tokens: int, output_tokens: int) -> None: |
| 445 | if not (pending_text or pending_tools or input_tokens or output_tokens): |
| 446 | return |
| 447 | steps.append( |
| 448 | { |
| 449 | "text_ids": list(pending_text), |
| 450 | "tool_ids": list(pending_tools), |
| 451 | "input_tokens": input_tokens, |
| 452 | "output_tokens": output_tokens, |
| 453 | } |
| 454 | ) |
| 455 | pending_text.clear() |
| 456 | pending_tools.clear() |
| 457 | |
| 458 | for index, event in enumerate(events): |
| 459 | part = _candidate_part(event) |
no outgoing calls
no test coverage detected