MCPcopy
hub / github.com/openai/openai-agents-python / extract_user_text

Function extract_user_text

tests/test_hitl_session_scenario.py:443–453  ·  view source on GitHub ↗
(item: dict[str, Any])

Source from the content-addressed store, hash-verified

441
442
443def extract_user_text(item: dict[str, Any]) -> str:
444 content = item.get("content")
445 if isinstance(content, str):
446 return content
447 if isinstance(content, list):
448 return "".join(
449 part.get("text", "")
450 for part in content
451 if isinstance(part, dict) and part.get("type") == "input_text"
452 )
453 return ""
454
455
456def extract_call_id(item: Any) -> str | None:

Callers 2

assert_step_itemsFunction · 0.85
get_last_user_textFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected