# Parse the complete structured response
structured_data = json.loads(complete_response)
print('\nParsed Product:', json.dumps(structured_data, indent=2))
```

> **💡 Note:** **Streaming assembly:** When using structured outputs with streaming, you'll
> need to collect all the content chunks and parse the complete JSON response
> once the stream is finished.


--------------------------------------------------------------------------------
title: "Tool Calls"
description: "Use OpenAI-compatible function calling to enable models to call tools and functions through the AI Gateway."
last_updated: "2026-02-03T02:58:36.239Z"
source: "https://vercel.com/docs/ai-gateway/sdks-and-apis/openai-compat/tool-calls"
--------------------------------------------------------------------------------