You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/input.md
+53-2Lines changed: 53 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# Image and Audio Input
1
+
# Image, Audio & Document Input
2
2
3
-
Some LLMs are now capable of understanding both audioand image content.
3
+
Some LLMs are now capable of understanding both audio, image and document content.
4
4
5
5
## Image Input
6
6
@@ -51,3 +51,54 @@ print(result.data)
51
51
Some models do not support audio input. Please check the model's documentation to confirm whether it supports audio input.
52
52
53
53
You can provide audio input using either [`AudioUrl`][pydantic_ai.AudioUrl] or [`BinaryContent`][pydantic_ai.BinaryContent]. The process is analogous to the examples above.
54
+
55
+
## Document Input
56
+
57
+
!!! info
58
+
Some models do not support document input. Please check the model's documentation to confirm whether it supports document input.
59
+
60
+
!!! warning
61
+
When using Gemini models, the document content will always be sent as binary data, regardless of whether you use `DocumentUrl` or `BinaryContent`. This is due to differences in how Vertex AI and Google AI handle document inputs.
62
+
63
+
For more details, see [this discussion](https://discuss.ai.google.dev/t/i-am-using-google-generative-ai-model-gemini-1-5-pro-for-image-analysis-but-getting-error/34866/4).
64
+
65
+
If you are unsatisfied with this behavior, please let us know by opening an issue on
You can provide document input using either [`DocumentUrl`][pydantic_ai.DocumentUrl] or [`BinaryContent`][pydantic_ai.BinaryContent]. The process is similar to the examples above.
69
+
70
+
If you have a direct URL for the document, you can use [`DocumentUrl`][pydantic_ai.DocumentUrl]:
0 commit comments