1. Define an available operation
change_outfit is an application-defined function. This example offers a pink skirt and a floral dress. Add the definition to conversation.tools in the session request.
2. Receive and execute the call
Handle the function_call inresponse.output_item.done. Parse arguments as a JSON string, validate the tool name and allowed values, then execute your business function. Deduplicate by session ID and call_id.