Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/openai/openai-agents-python
/ _get_field
Function
_get_field
examples/tools/code_interpreter.py:8–11 ·
view source on GitHub ↗
(obj: Any, key: str)
Source
from the content-addressed store, hash-verified
6
7
8
def
_get_field(obj: Any, key: str) -> Any:
9
if
isinstance(obj, Mapping):
10
return
obj.get(key)
11
return
getattr(obj, key, None)
12
13
14
async
def
main():
Callers
1
main
Function · 0.70
Calls
1
get
Method · 0.45
Tested by
no test coverage detected