Skip to content

Commit

Permalink
[Vertex AI] Remove generateImages(prompt:gcsURI:) from public API (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewheard authored Feb 13, 2025
1 parent ba8869c commit 998dbec
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
import Foundation

/// An image generated by Imagen, stored in Cloud Storage (GCS) for Firebase.
///
/// TODO(#14451): Make this `public` and move to the `Public` directory when ready.
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
public struct ImagenGCSImage {
struct ImagenGCSImage {
/// The IANA standard MIME type of the image file; either `"image/png"` or `"image/jpeg"`.
///
/// > Note: To request a different format, set ``ImagenGenerationConfig/imageFormat`` in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ import Foundation

/// A response from a request to generate images with Imagen.
///
/// The type placeholder `T` is an image type of either ``ImagenInlineImage`` or ``ImagenGCSImage``.
/// The type placeholder `T` is an image type; this is currently always an ``ImagenInlineImage``.
///
/// This type is returned from:
/// - ``ImagenModel/generateImages(prompt:)`` where `T` is ``ImagenInlineImage``
/// - ``ImagenModel/generateImages(prompt:gcsURI:)`` where `T` is ``ImagenGCSImage``
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
// TODO(#14451): Re-add "- ``ImagenModel/generateImages(prompt:gcsURI:)`` where `T` is
// ``ImagenGCSImage``" in the DocC above.
public struct ImagenGenerationResponse<T> {
/// The images generated by Imagen; see ``ImagenInlineImage`` and ``ImagenGCSImage``.
/// The images generated by Imagen; see ``ImagenInlineImage``.
///
/// > Important: The number of images generated may be fewer than the number requested if one or
/// more were filtered out; see ``filteredReason``.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ public final class ImagenModel {
/// - prompt: A text prompt describing the image(s) to generate.
/// - gcsURI: The Cloud Storage (GCS) for Firebase URI where the generated images are stored.
/// This is a `"gs://"`-prefixed URI , for example, `"gs://bucket-name/path/"`.
public func generateImages(prompt: String, gcsURI: String) async throws
///
/// TODO(#14451): Make this `public` when backend support is ready.
func generateImages(prompt: String, gcsURI: String) async throws
-> ImagenGenerationResponse<ImagenGCSImage> {
return try await generateImages(
prompt: prompt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import VertexAITestApp
import UIKit
#endif // canImport(UIKit)

// TODO(#14452): Remove `@testable import` when `generateImages(prompt:gcsURI:)` is public.
@testable import class FirebaseVertexAI.ImagenModel

@Suite(
.enabled(
if: ProcessInfo.processInfo.environment["VTXIntegrationImagen"] != nil,
Expand Down

0 comments on commit 998dbec

Please sign in to comment.