Skip to main content
Declare function tools in session.update:
When the model calls a tool, the server streams response.function_call_arguments.delta events and finishes with response.function_call_arguments.done, then ends the response with response.done carrying the completed function_call item (call_id, name, arguments). It is now your client’s turn:
  1. Execute the function locally with the provided arguments.
  2. Return the result with conversation.item.create (type: "function_call_output", echoing the call_id).
  3. Send response.create — the model continues with the result and speaks the answer.
The core handler flow is shown below. Pass the connected WebSocket as ws: