Skip to content

Commit ce6bf90

Browse files
authored
Document that Gemini requires native or prompted output mode for structured output streaming (#3032)
1 parent 107dc8d commit ce6bf90

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/output.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,10 @@ async def main():
581581

582582
_(This example is complete, it can be run "as is" — you'll need to add `asyncio.run(main())` to run `main`)_
583583

584+
As setting an `output_type` uses the [Tool Output](#tool-output) mode by default, this will only work if the model supports streaming tool arguments. For models that don't, like Gemini, try [Native Output](#native-output) or [Prompted Output](#prompted-output) instead.
585+
586+
### Streaming Model Responses
587+
584588
If you want fine-grained control of validation, you can use the following pattern to get the entire partial [`ModelResponse`][pydantic_ai.messages.ModelResponse]:
585589

586590
```python {title="streamed_user_profile.py" line_length="120"}

0 commit comments

Comments
 (0)