File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,10 @@ public struct ModelContent: Equatable {
35
35
36
36
/// URI-based data with a specified media type.
37
37
///
38
+ /// > Important: Files must be uploaded using the
39
+ /// > [`media.upload` REST API](https://ai.google.dev/api/rest/v1beta/media/upload) or another
40
+ /// > Gemini SDK.
41
+ ///
38
42
/// > Note: Supported media types depends on the model; see
39
43
/// > [supported file
40
44
/// > formats](https://ai.google.dev/tutorials/prompting_with_media#supported_file_formats)
Original file line number Diff line number Diff line change @@ -91,6 +91,13 @@ final class GoogleGenerativeAITests: XCTestCase {
91
91
let _ = try await genAI. generateContent ( str)
92
92
let _ = try await genAI. generateContent ( [ str] )
93
93
let _ = try await genAI. generateContent ( str, " abc " , " def " )
94
+ let _ = try await genAI. generateContent (
95
+ str,
96
+ ModelContent . Part. fileData (
97
+ mimetype: " image/jpeg " ,
98
+ uri: " https://generativelanguage.googleapis.com/v1beta/files/rand0mha5sh "
99
+ )
100
+ )
94
101
#if canImport(UIKit)
95
102
_ = try await genAI. generateContent ( UIImage ( ) )
96
103
_ = try await genAI. generateContent ( [ UIImage ( ) ] )
You can’t perform that action at this time.
0 commit comments