MCPcopy Index your code
hub / github.com/openai/openai-agents-python / _get_function_span

Function _get_function_span

tests/test_computer_action.py:58–68  ·  view source on GitHub ↗
(tool_name: str)

Source from the content-addressed store, hash-verified

56
57
58def _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
71def _get_agent_span(agent_name: str) -> dict[str, Any]:

Calls 3

get_ordered_spansMethod · 0.80
exportMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected