|
14 | 14 |
|
15 | 15 | import Foundation |
16 | 16 |
|
17 | | -/// Represents the available response modalities. |
| 17 | +/// Represents the different types, or modalities, of data that a model can produce as output. |
| 18 | +/// |
| 19 | +/// To configure the desired output modalities for model requests, set the `responseModalities` |
| 20 | +/// parameter when initializing a ``GenerationConfig``. See the [multimodal |
| 21 | +/// responses](https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal-response-generation) |
| 22 | +/// documentation for more details. |
| 23 | +/// |
| 24 | +/// > Important: Support for each response modality, or combination of modalities, depends on the |
| 25 | +/// > model. |
18 | 26 | @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) |
19 | 27 | public struct ResponseModality: EncodableProtoEnum, Sendable { |
20 | 28 | enum Kind: String { |
21 | 29 | case text = "TEXT" |
22 | 30 | case image = "IMAGE" |
23 | | - case audio = "AUDIO" |
24 | 31 | } |
25 | 32 |
|
26 | | - /// Text response modality. |
| 33 | + /// Specifies that the model should generate textual content. |
| 34 | + /// |
| 35 | + /// Use this modality when you need the model to produce written language, such as answers to |
| 36 | + /// questions, summaries, creative writing, code snippets, or structured data formats like JSON. |
27 | 37 | public static let text = ResponseModality(kind: .text) |
28 | 38 |
|
29 | | - /// Image response modality. |
| 39 | + /// **Public Experimental**: Specifies that the model should generate image data. |
| 40 | + /// |
| 41 | + /// Use this modality when you want the model to create visual content based on the provided input |
| 42 | + /// or prompts. The response might contain one or more generated images. See the [image |
| 43 | + /// generation](https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal-response-generation#image-generation) |
| 44 | + /// documentation for more details. |
| 45 | + /// |
| 46 | + /// > Warning: Image generation using Gemini 2.0 Flash is a **Public Experimental** feature, which |
| 47 | + /// > means that it is not subject to any SLA or deprecation policy and could change in |
| 48 | + /// > backwards-incompatible ways. |
30 | 49 | public static let image = ResponseModality(kind: .image) |
31 | 50 |
|
32 | | - /// Audio response modality. |
33 | | - public static let audio = ResponseModality(kind: .audio) |
34 | | - |
35 | 51 | let rawValue: String |
36 | 52 | } |
0 commit comments