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

Function _get_function_span

tests/test_shell_tool.py:37–47  ·  view source on GitHub ↗
(tool_name: str)

Source from the content-addressed store, hash-verified

35
36
37def _get_function_span(tool_name: str) -> dict[str, Any]:
38 for span in SPAN_PROCESSOR_TESTING.get_ordered_spans(including_empty=True):
39 exported = span.export()
40 if not exported:
41 continue
42 span_data = exported.get("span_data")
43 if not isinstance(span_data, dict):
44 continue
45 if span_data.get("type") == "function" and span_data.get("name") == tool_name:
46 return exported
47 raise AssertionError(f"Function span for tool '{tool_name}' not found")
48
49
50def _shell_call(call_id: str = "call_shell") -> dict[str, Any]:

Calls 3

get_ordered_spansMethod · 0.80
exportMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected