FirebaseAILogic Framework Reference

Classes

The following classes are available globally.

  • An object that represents a back-and-forth chat with a model, capturing the history and saving the context in memory between each message sent.

    Declaration

    Swift

    @available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
    public final class Chat : Sendable
  • The Firebase AI SDK provides access to Gemini models directly from your app.

    Declaration

    Swift

    @available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
    public final class FirebaseAI : Sendable
  • A type that represents a remote multimodal model (like Gemini), with the ability to generate content based on various input types.

    Declaration

    Swift

    @available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
    public final class GenerativeModel : Sendable
  • Represents a remote Imagen model with the ability to generate images using text prompts.

    See the generate images documentation for more details about the image generation capabilities offered by the Imagen model in the Firebase AI SDK SDK.

    Declaration

    Swift

    @available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
    public final class ImagenModel
  • A multimodal model (like Gemini) capable of real-time content generation based on various input types, supporting bidirectional streaming.

    You can create a new session via connect().

    Declaration

    Swift

    @available(iOS 15.0, macOS 12.0, tvOS 15.0, *)
    @available(watchOS, unavailable)
    public final class LiveGenerativeModel
  • A live WebSocket session, capable of streaming content to and from the model.

    Messages are streamed through responses, and can be sent through either the dedicated realtime API function (such as sendAudioRealtime(_:) and sendTextRealtime(_:)), or through the incremental API (such as sendContent(_:turnComplete:)).

    To create an instance of this class, see LiveGenerativeModel.

    Declaration

    Swift

    @available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
    @available(watchOS, unavailable)
    public final class LiveSession : Sendable
  • A Schema object allows the definition of input and output data types.

    These types can be objects, but also primitives and arrays. Represents a select subset of an OpenAPI 3.0 schema object.

    Declaration

    Swift

    @available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
    public final class Schema : Sendable
    extension Schema: Encodable