FirebaseAILogic Framework Reference

Protocols

The following protocols are available globally.

  • A protocol describing any data that could be serialized to model-interpretable input data, where the serialization process cannot fail with an error.

    Declaration

    Swift

    public protocol PartsRepresentable
  • A discrete piece of data in a media format interpretable by an AI model.

    Within a single value of Part, different data types may not mix.

    Declaration

    Swift

    public protocol Part : PartsRepresentable, Decodable, Encodable, Equatable, Sendable
  • A type that represents options for controlling model response generation.

    For Gemini models, this may be a GenerationConfig value. For the SystemLanguageModel provided by the Apple Foundation Models framework, this may be a GenerationOptions or a Foundation Models GenerationOptions value. For hybrid (on-device and cloud) configurations, use hybrid(gemini:foundationModels:)-(_,FirebaseAI.GenerationOptions) to specify options for each model.

    Declaration

    Swift

    public protocol GenerationOptionsRepresentable : Sendable
  • A type that represents a large language model (LLM).

    Declaration

    Swift

    public protocol LanguageModel : LanguageModelProvider
  • A type that represents a large language model (LLM).

    Declaration

    Swift

    public protocol LanguageModelProvider : Sendable
  • _ModelSession

    A type that represents a session for interacting with a LanguageModel.

    Declaration

    Swift

    public protocol _ModelSession : Sendable
  • Undocumented

    Declaration

    Swift

    public protocol ToolRepresentable : Sendable