(tool_name: str)
| 56 | |
| 57 | |
| 58 | def _get_function_span(tool_name: str) -> dict[str, Any]: |
| 59 | for span in SPAN_PROCESSOR_TESTING.get_ordered_spans(including_empty=True): |
| 60 | exported = span.export() |
| 61 | if not exported: |
| 62 | continue |
| 63 | span_data = exported.get("span_data") |
| 64 | if not isinstance(span_data, dict): |
| 65 | continue |
| 66 | if span_data.get("type") == "function" and span_data.get("name") == tool_name: |
| 67 | return exported |
| 68 | raise AssertionError(f"Function span for tool '{tool_name}' not found") |
| 69 | |
| 70 | |
| 71 | def _get_agent_span(agent_name: str) -> dict[str, Any]: |
no test coverage detected