in src/agents/models/chatcmpl_converter.py [0:0]
def maybe_easy_input_message(cls, item: Any) -> EasyInputMessageParam | None:
if not isinstance(item, dict):
return None
keys = item.keys()
# EasyInputMessageParam only has these two keys
if keys != {"content", "role"}:
return None
role = item.get("role", None)
if role not in ("user", "assistant", "system", "developer"):
return None
if "content" not in item:
return None
return cast(EasyInputMessageParam, item)