Skip to content

Commit 3de5e75

Browse files
authored
Update GenerationConfig.swift
1 parent dc0dd67 commit 3de5e75

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Sources/GoogleAI/GenerationConfig.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ public struct GenerationConfig {
7676
/// this is limited to `application/json`.
7777
public let responseSchema: Schema?
7878

79+
/// Array of output response modalities
80+
///
81+
/// Supported modalities:
82+
/// - `text`: Text output
83+
/// - `image`: Image output
84+
public let responseModalities: [String]?
85+
7986
/// Creates a new `GenerationConfig` value.
8087
///
8188
/// - Parameters:
@@ -87,10 +94,11 @@ public struct GenerationConfig {
8794
/// - stopSequences: See ``stopSequences``.
8895
/// - responseMIMEType: See ``responseMIMEType``.
8996
/// - responseSchema: See ``responseSchema``.
97+
/// - responseModalities: See ``responseModalities``.
9098
public init(temperature: Float? = nil, topP: Float? = nil, topK: Int? = nil,
9199
candidateCount: Int? = nil, maxOutputTokens: Int? = nil,
92100
stopSequences: [String]? = nil, responseMIMEType: String? = nil,
93-
responseSchema: Schema? = nil) {
101+
responseSchema: Schema? = nil, responseModalities: [String]? = nil) {
94102
// Explicit init because otherwise if we re-arrange the above variables it changes the API
95103
// surface.
96104
self.temperature = temperature
@@ -101,6 +109,7 @@ public struct GenerationConfig {
101109
self.stopSequences = stopSequences
102110
self.responseMIMEType = responseMIMEType
103111
self.responseSchema = responseSchema
112+
self.responseModalities = responseModalities
104113
}
105114
}
106115

0 commit comments

Comments
 (0)