Handoff filters
Contains common handoff input filters, for convenience.
default_handoff_history_mapper
default_handoff_history_mapper(
transcript: list[TResponseInputItem],
) -> list[TResponseInputItem]
Return a single assistant message summarizing the transcript.
Source code in src/agents/handoffs/history.py
nest_handoff_history
nest_handoff_history(
handoff_input_data: HandoffInputData,
*,
history_mapper: HandoffHistoryMapper | None = None,
) -> HandoffInputData
Summarize the previous transcript for the next agent without redacting sensitive data.
The transcript is built from input_history, pre_handoff_items, and new_items.
Any existing input_items override is ignored. Tool arguments and outputs from those
source fields can therefore remain in the generated summary text.
Sanitize all three source fields before calling this function, or sanitize the returned
input_history before forwarding the nested result. Sanitizing the returned history
allows the original new_items to remain available for session history. Filtering only
input_items does not prevent sensitive content from entering nested history.
Source code in src/agents/handoffs/history.py
remove_all_tools
remove_all_tools(
handoff_input_data: HandoffInputData,
) -> HandoffInputData
Filters out all tool items: file search, web search and function calls+output.