MCPcopy Create free account
hub / github.com/openai/openai-agents-python / read_context_value

Function read_context_value

examples/tools/codex_same_thread.py:55–59  ·  view source on GitHub ↗
(context: Mapping[str, str] | BaseModel, key: str)

Source from the content-addressed store, hash-verified

53
54
55def read_context_value(context: Mapping[str, str] | BaseModel, key: str) -> str | None:
56 # either dict or pydantic model
57 if isinstance(context, Mapping):
58 return context.get(key)
59 return getattr(context, key, None)
60
61
62async def main() -> None:

Callers 1

mainFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected