Skip to main content

Module request

Module request 

Source
Expand description

Request conversion: Responses API → Chat API.

Functions§

convert_input_to_messages
Convert input (with optional instructions) to Chat messages.
convert_tool_choice
Convert Responses API tool choice to Chat API tool choice.
convert_tools
Convert Responses API tools to Chat API tools.
extract_content
Extract text content from Response API content.
is_tool_choice_none
Check if the tool choice is “none” (no tools).
response_to_chat
Convert a Responses API request to a Chat API request.