FirebaseAILogic Framework Reference

Backend

public struct Backend

Represents available backend APIs for the Firebase AI SDK.

  • Initializes a Backend configured for the Gemini API in Vertex AI.

    Defaults to the location us-central1; see Vertex AI locations for a list of supported locations.

    Declaration

    Swift

    @available(*, deprecated, message: "Use agentPlatform(location:﹚ instead; note that the default location is now \"global\" instead of \"us-central1\"")
    public static func vertexAI() -> Backend
  • Initializes a Backend configured for the Gemini API in Vertex AI.

    Declaration

    Swift

    @available(*, deprecated, renamed: "agentPlatform(location:﹚", message: "Vertex AI has been renamed to the Agent Platform Gemini API.")
    public static func vertexAI(location: String) -> Backend

    Parameters

    location

    The region identifier; see Vertex AI locations for a list of supported locations.

  • Initializes a Backend configured for the Agent Platform Gemini API.

    Note

    The Agent Platform Gemini API was formerly known as Vertex AI.

    Declaration

    Swift

    public static func agentPlatform(location: String = "global") -> Backend

    Parameters

    location

    The region identifier, defaulting to global; see Vertex AI locations for a list of supported locations.

  • Initializes a Backend configured for the Gemini Developer API.

    Declaration

    Swift

    public static func googleAI() -> Backend