I am building an agentic chatbot that utilizes SQLiteSession persistence in order to remember and store context from previous back-and-forths within the same conversation session. When retrieving items via session.get_items(), I notice each item has been stored as a TResponseInputItem object, which follows a specific formatting depending on the type of output (function tool call, output message, etc). I dug into the add_items() definition of the sqlite_session.py from the official OpenAI Agents SDK repository, but could not find/did not understand how each event from the streamed agent responses is put into a certain response input item data type.
Are the events streamed by an OpenAI agent initially created as response input items or are they converted somewhere into a specific response input item type corresponding to the event item type? And if it’s the latter, how is each response input item formatted to fit each event item? I’m trying to investigate the possibilities of response input item formats that can be generated to the session from an agent run.