MCPcopy
hub / github.com/openai/openai-agents-python / to_input_list

Method to_input_list

src/agents/result.py:287–305  ·  view source on GitHub ↗

Create an input-item view of this run. ``mode="preserve_all"`` keeps the historical behavior of converting ``new_items`` into a full plain-item history. ``mode="normalized"`` prefers the canonical continuation input when handoff filtering rewrote model history, while remaini

(
        self,
        *,
        mode: ToInputListMode = "preserve_all",
    )

Source from the content-addressed store, hash-verified

285 return cast(T, self.final_output)
286
287 def to_input_list(
288 self,
289 *,
290 mode: ToInputListMode = "preserve_all",
291 ) -> list[TResponseInputItem]:
292 """Create an input-item view of this run.
293
294 ``mode="preserve_all"`` keeps the historical behavior of converting ``new_items`` into a
295 full plain-item history. ``mode="normalized"`` prefers the canonical continuation input
296 when handoff filtering rewrote model history, while remaining identical for ordinary runs.
297 """
298 original_items: list[TResponseInputItem] = ItemHelpers.input_to_new_input_list(self.input)
299 reasoning_item_id_policy = getattr(self, "_reasoning_item_id_policy", None)
300 replay_items = _input_items_for_result(
301 self,
302 mode=mode,
303 reasoning_item_id_policy=reasoning_item_id_policy,
304 )
305 return original_items + replay_items
306
307 @property
308 def agent_tool_invocation(self) -> AgentToolInvocation | None:

Callers 15

run_demo_loopFunction · 0.45
runMethod · 0.45
_run_turnFunction · 0.45
run_turnFunction · 0.45
print_streamed_resultFunction · 0.45
run_stepFunction · 0.45
run_turnFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 2

_input_items_for_resultFunction · 0.85

Tested by

no test coverage detected