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

Method _write_items

examples/memory/file_session.py:101–105  ·  view source on GitHub ↗
(self, session_id: str, items: list[Any])

Source from the content-addressed store, hash-verified

99 return []
100
101 async def _write_items(self, session_id: str, items: list[Any]) -> None:
102 file_path = self._items_path(session_id)
103 payload = json.dumps(items, indent=2, ensure_ascii=False)
104 await asyncio.to_thread(self._dir.mkdir, parents=True, exist_ok=True)
105 await asyncio.to_thread(file_path.write_text, payload, encoding="utf-8")
106
107 async def load_state_json(self) -> dict[str, Any] | None:
108 """Load a previously saved RunState JSON payload, if present."""

Callers 2

add_itemsMethod · 0.95
pop_itemMethod · 0.95

Calls 1

_items_pathMethod · 0.95

Tested by

no test coverage detected