diff --git a/FirebaseAI.podspec b/FirebaseAI.podspec index e6fc558b0bc..a4e2e1e49be 100644 --- a/FirebaseAI.podspec +++ b/FirebaseAI.podspec @@ -19,9 +19,9 @@ Build AI-powered apps and features with the Gemini API using the Firebase AI SDK s.social_media_url = 'https://twitter.com/Firebase' ios_deployment_target = '15.0' - osx_deployment_target = '12.0' + osx_deployment_target = '10.15' tvos_deployment_target = '15.0' - watchos_deployment_target = '8.0' + watchos_deployment_target = '7.0' s.ios.deployment_target = ios_deployment_target s.osx.deployment_target = osx_deployment_target diff --git a/FirebaseAI/Sources/AILog.swift b/FirebaseAI/Sources/AILog.swift index 345451bf07f..a6c1b9eed7e 100644 --- a/FirebaseAI/Sources/AILog.swift +++ b/FirebaseAI/Sources/AILog.swift @@ -139,7 +139,6 @@ enum AILog { log(level: .debug, code: code, message) } - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) static func makeInternalError(message: String, code: MessageCode) -> GenerateContentError { let error = GenerateContentError.internalError(underlying: NSError( domain: "\(Constants.baseErrorDomain).Internal", diff --git a/FirebaseAI/Sources/Chat.swift b/FirebaseAI/Sources/Chat.swift index 59911e9de95..6df47d96670 100644 --- a/FirebaseAI/Sources/Chat.swift +++ b/FirebaseAI/Sources/Chat.swift @@ -16,7 +16,6 @@ import Foundation /// 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. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public final class Chat: Sendable { private let model: GenerativeModel private let _history: History @@ -62,7 +61,7 @@ public final class Chat: Sendable { /// and response will be added to the history. If unsuccessful, history will remain unchanged. /// - Parameter parts: The new content to send as a single chat message. /// - Returns: A stream containing the model's response or an error if an error occurred. - @available(macOS 12.0, *) + @available(macOS 12.0, watchOS 8.0, *) public func sendMessageStream(_ parts: any PartsRepresentable...) throws -> AsyncThrowingStream { return try sendMessageStream([ModelContent(parts: parts)]) @@ -72,7 +71,7 @@ public final class Chat: Sendable { /// and response will be added to the history. If unsuccessful, history will remain unchanged. /// - Parameter content: The new content to send as a single chat message. /// - Returns: A stream containing the model's response or an error if an error occurred. - @available(macOS 12.0, *) + @available(macOS 12.0, watchOS 8.0, *) public func sendMessageStream(_ content: [ModelContent]) throws -> AsyncThrowingStream { return try sendMessageStream(content, generationConfig: generationConfig) @@ -106,6 +105,7 @@ public final class Chat: Sendable { return result } + @available(macOS 12.0, watchOS 8.0, *) func sendMessageStream(_ content: [ModelContent], generationConfig: GenerationConfig?) throws -> AsyncThrowingStream { // Ensure that the new content has the role set. diff --git a/FirebaseAI/Sources/Extensions/Internal/GenerationSchema+Gemini.swift b/FirebaseAI/Sources/Extensions/Internal/GenerationSchema+Gemini.swift index 88d7054cd4e..8d94798f895 100644 --- a/FirebaseAI/Sources/Extensions/Internal/GenerationSchema+Gemini.swift +++ b/FirebaseAI/Sources/Extensions/Internal/GenerationSchema+Gemini.swift @@ -14,7 +14,6 @@ import Foundation -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension FirebaseAI.GenerationSchema { /// Returns a Gemini-compatible JSON Schema of this `GenerationSchema`. func toGeminiJSONSchema() throws -> JSONObject { diff --git a/FirebaseAI/Sources/FirebaseAI.swift b/FirebaseAI/Sources/FirebaseAI.swift index 87bd3ccf804..4cfef987554 100644 --- a/FirebaseAI/Sources/FirebaseAI.swift +++ b/FirebaseAI/Sources/FirebaseAI.swift @@ -21,7 +21,6 @@ import Foundation internal import FirebaseCoreExtension /// The Firebase AI SDK provides access to Gemini models directly from your app. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public final class FirebaseAI: Sendable { // MARK: - Public APIs @@ -197,7 +196,6 @@ public final class FirebaseAI: Sendable { /// - systemInstruction: Instructions that direct the model to behave a certain way; currently /// only text content is supported. /// - requestOptions: Configuration parameters for sending requests to the backend. - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) public func liveModel(modelName: String, generationConfig: LiveGenerationConfig? = nil, diff --git a/FirebaseAI/Sources/FirebaseInfo.swift b/FirebaseAI/Sources/FirebaseInfo.swift index 6b10dec4e5f..160dfc787ae 100644 --- a/FirebaseAI/Sources/FirebaseInfo.swift +++ b/FirebaseAI/Sources/FirebaseInfo.swift @@ -20,7 +20,6 @@ import Foundation @preconcurrency import FirebaseCore /// Firebase data used by FirebaseAI -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) struct FirebaseInfo: Sendable { let appCheck: AppCheckInterop? let auth: AuthInterop? diff --git a/FirebaseAI/Sources/GenerateContentError.swift b/FirebaseAI/Sources/GenerateContentError.swift index 76ce516f3cf..4607edd327d 100644 --- a/FirebaseAI/Sources/GenerateContentError.swift +++ b/FirebaseAI/Sources/GenerateContentError.swift @@ -15,7 +15,6 @@ import Foundation /// Errors that occur when generating content from a model. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public enum GenerateContentError: Error { /// An internal error occurred. See the underlying error for more context. case internalError(underlying: Error) diff --git a/FirebaseAI/Sources/GenerateContentRequest.swift b/FirebaseAI/Sources/GenerateContentRequest.swift index bc4e9797760..9ff9edb68bc 100644 --- a/FirebaseAI/Sources/GenerateContentRequest.swift +++ b/FirebaseAI/Sources/GenerateContentRequest.swift @@ -14,7 +14,6 @@ import Foundation -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) struct GenerateContentRequest: Sendable { /// Model name. let model: String @@ -31,7 +30,6 @@ struct GenerateContentRequest: Sendable { let options: RequestOptions } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension GenerateContentRequest: Encodable { enum CodingKeys: String, CodingKey { case model @@ -60,7 +58,6 @@ extension GenerateContentRequest: Encodable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension GenerateContentRequest { enum APIMethod: String { case generateContent @@ -69,7 +66,6 @@ extension GenerateContentRequest { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension GenerateContentRequest: GenerativeAIRequest { typealias Response = GenerateContentResponse diff --git a/FirebaseAI/Sources/GenerateContentResponse.swift b/FirebaseAI/Sources/GenerateContentResponse.swift index 648ed0d15c0..a9f517b5cc1 100644 --- a/FirebaseAI/Sources/GenerateContentResponse.swift +++ b/FirebaseAI/Sources/GenerateContentResponse.swift @@ -15,10 +15,8 @@ import Foundation /// The model's response to a generate content request. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct GenerateContentResponse: Sendable { /// Token usage metadata for processing the generate content request. - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct UsageMetadata: Sendable { /// The number of tokens in the request prompt. public let promptTokenCount: Int @@ -155,7 +153,6 @@ public struct GenerateContentResponse: Sendable { /// A struct representing a possible reply to a content generation prompt. Each content generation /// prompt may produce multiple candidate responses. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct Candidate: Sendable { /// The response's content. public let content: ModelContent @@ -196,14 +193,12 @@ public struct Candidate: Sendable { } /// A collection of source attributions for a piece of content. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct CitationMetadata: Sendable { /// A list of individual cited sources and the parts of the content to which they apply. public let citations: [Citation] } /// A struct describing a source attribution. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct Citation: Sendable, Equatable { /// The inclusive beginning of a sequence in a model response that derives from a cited source. public let startIndex: Int @@ -241,7 +236,6 @@ public struct Citation: Sendable, Equatable { } /// A value enumerating possible reasons for a model to terminate a content generation request. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct FinishReason: DecodableProtoEnum, Hashable, Sendable { enum Kind: String { case stop = "STOP" @@ -296,10 +290,8 @@ public struct FinishReason: DecodableProtoEnum, Hashable, Sendable { } /// A metadata struct containing any feedback the model had on the prompt it was provided. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct PromptFeedback: Sendable { /// A type describing possible reasons to block a prompt. - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct BlockReason: DecodableProtoEnum, Hashable, Sendable { enum Kind: String { case safety = "SAFETY" @@ -355,7 +347,6 @@ public struct PromptFeedback: Sendable { /// [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) /// or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) /// section within the Service Specific Terms). -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct GroundingMetadata: Sendable, Equatable, Hashable { /// A list of web search queries that the model performed to gather the grounding information. /// These can be used to allow users to explore the search results themselves. @@ -372,7 +363,6 @@ public struct GroundingMetadata: Sendable, Equatable, Hashable { public let searchEntryPoint: SearchEntryPoint? /// A struct representing the Google Search entry point. - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct SearchEntryPoint: Sendable, Equatable, Hashable { /// An HTML/CSS snippet that can be embedded in your app. /// @@ -382,14 +372,12 @@ public struct GroundingMetadata: Sendable, Equatable, Hashable { /// Represents a chunk of retrieved data that supports a claim in the model's response. This is /// part of the grounding information provided when grounding is enabled. - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct GroundingChunk: Sendable, Equatable, Hashable { /// Contains details if the grounding chunk is from a web source. public let web: WebGroundingChunk? } /// A grounding chunk sourced from the web. - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct WebGroundingChunk: Sendable, Equatable, Hashable { /// The URI of the retrieved web page. public let uri: String? @@ -403,7 +391,6 @@ public struct GroundingMetadata: Sendable, Equatable, Hashable { /// Provides information about how a specific segment of the model's response is supported by the /// retrieved grounding chunks. - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct GroundingSupport: Sendable, Equatable, Hashable { /// Specifies the segment of the model's response content that this grounding support pertains /// to. @@ -436,7 +423,6 @@ public struct GroundingMetadata: Sendable, Equatable, Hashable { /// Represents a specific segment within a ``ModelContent`` struct, often used to pinpoint the /// exact location of text or data that grounding information refers to. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct Segment: Sendable, Equatable, Hashable { /// The zero-based index of the ``Part`` object within the `parts` array of its parent /// ``ModelContent`` object. This identifies which part of the content the segment belongs to. @@ -454,7 +440,6 @@ public struct Segment: Sendable, Equatable, Hashable { // MARK: - Codable Conformances -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension GenerateContentResponse: Decodable { enum CodingKeys: String, CodingKey { case candidates @@ -490,7 +475,6 @@ extension GenerateContentResponse: Decodable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension GenerateContentResponse.UsageMetadata: Decodable { enum CodingKeys: CodingKey { case promptTokenCount @@ -532,7 +516,6 @@ extension GenerateContentResponse.UsageMetadata: Decodable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension Candidate: Decodable { enum CodingKeys: CodingKey { case content @@ -593,7 +576,6 @@ extension Candidate: Decodable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension CitationMetadata: Decodable { enum CodingKeys: CodingKey { case citations // Vertex AI @@ -612,7 +594,6 @@ extension CitationMetadata: Decodable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension Citation: Decodable { enum CodingKeys: CodingKey { case startIndex @@ -664,7 +645,6 @@ extension Citation: Decodable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension PromptFeedback: Decodable { enum CodingKeys: CodingKey { case blockReason @@ -690,7 +670,6 @@ extension PromptFeedback: Decodable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension GroundingMetadata: Decodable { enum CodingKeys: String, CodingKey { case webSearchQueries @@ -717,16 +696,12 @@ extension GroundingMetadata: Decodable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension GroundingMetadata.SearchEntryPoint: Decodable {} -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension GroundingMetadata.GroundingChunk: Decodable {} -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension GroundingMetadata.WebGroundingChunk: Decodable {} -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension GroundingMetadata.GroundingSupport.Internal: Decodable { enum CodingKeys: String, CodingKey { case segment @@ -743,7 +718,6 @@ extension GroundingMetadata.GroundingSupport.Internal: Decodable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension Segment: Decodable { enum CodingKeys: String, CodingKey { case partIndex diff --git a/FirebaseAI/Sources/GenerationConfig.swift b/FirebaseAI/Sources/GenerationConfig.swift index f420e7fee44..830f5b68df0 100644 --- a/FirebaseAI/Sources/GenerationConfig.swift +++ b/FirebaseAI/Sources/GenerationConfig.swift @@ -16,7 +16,6 @@ import Foundation /// A struct defining model parameters to be used when sending generative AI /// requests to the backend model. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct GenerationConfig: Sendable { /// Controls the degree of randomness in token selection. var temperature: Float? @@ -255,7 +254,6 @@ public struct GenerationConfig: Sendable { // MARK: - Codable Conformances -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension GenerationConfig: Encodable { enum CodingKeys: String, CodingKey { case temperature diff --git a/FirebaseAI/Sources/GenerativeAIRequest.swift b/FirebaseAI/Sources/GenerativeAIRequest.swift index 192de607137..a82d8284919 100644 --- a/FirebaseAI/Sources/GenerativeAIRequest.swift +++ b/FirebaseAI/Sources/GenerativeAIRequest.swift @@ -14,7 +14,6 @@ import Foundation -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) protocol GenerativeAIRequest: Sendable, Encodable { associatedtype Response: Sendable, Decodable @@ -24,7 +23,6 @@ protocol GenerativeAIRequest: Sendable, Encodable { } /// Configuration parameters for sending requests to the backend. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct RequestOptions: Sendable { /// The request’s timeout interval in seconds; if not specified uses the default value for a /// `URLRequest`. @@ -39,5 +37,4 @@ public struct RequestOptions: Sendable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension RequestOptions: Equatable {} diff --git a/FirebaseAI/Sources/GenerativeAIService.swift b/FirebaseAI/Sources/GenerativeAIService.swift index da2c4b6a283..a482e1db45f 100644 --- a/FirebaseAI/Sources/GenerativeAIService.swift +++ b/FirebaseAI/Sources/GenerativeAIService.swift @@ -18,7 +18,6 @@ import FirebaseCore import Foundation import os.log -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) struct GenerativeAIService { /// The language of the SDK in the format `gl-/`. static let languageTag = "gl-swift/5" @@ -39,7 +38,9 @@ struct GenerativeAIService { let urlRequest = try await urlRequest(request: request) #if DEBUG - printCURLCommand(from: urlRequest) + if #available(macOS 11.0, *) { + printCURLCommand(from: urlRequest) + } #endif let data: Data @@ -67,7 +68,7 @@ struct GenerativeAIService { return try parseResponse(T.Response.self, from: data) } - @available(macOS 12.0, *) + @available(macOS 12.0, watchOS 8.0, *) func loadRequestStream(request: T) -> AsyncThrowingStream where T: Sendable { return AsyncThrowingStream { continuation in @@ -301,6 +302,7 @@ struct GenerativeAIService { } #if DEBUG + @available(macOS 11.0, *) private func cURLCommand(from request: URLRequest) -> String { var returnValue = "curl " if let allHeaders = request.allHTTPHeaderFields { @@ -320,6 +322,7 @@ struct GenerativeAIService { return returnValue } + @available(macOS 11.0, *) private func printCURLCommand(from request: URLRequest) { guard AILog.additionalLoggingEnabled() else { return diff --git a/FirebaseAI/Sources/GenerativeModel.swift b/FirebaseAI/Sources/GenerativeModel.swift index d180c98248d..765b0252ac2 100644 --- a/FirebaseAI/Sources/GenerativeModel.swift +++ b/FirebaseAI/Sources/GenerativeModel.swift @@ -18,7 +18,6 @@ import Foundation /// A type that represents a remote multimodal model (like Gemini), with the ability to generate /// content based on various input types. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public final class GenerativeModel: Sendable { /// Model name prefix to identify Gemini models. static let geminiModelNamePrefix = "gemini-" @@ -161,7 +160,7 @@ public final class GenerativeModel: Sendable { /// conforming types). /// - Returns: A stream wrapping content generated by the model or a ``GenerateContentError`` /// error if an error occurred. - @available(macOS 12.0, *) + @available(macOS 12.0, watchOS 8.0, *) public func generateContentStream(_ parts: any PartsRepresentable...) throws -> AsyncThrowingStream { return try generateContentStream([ModelContent(parts: parts)]) @@ -172,7 +171,7 @@ public final class GenerativeModel: Sendable { /// - Parameter content: The input(s) given to the model as a prompt. /// - Returns: A stream wrapping content generated by the model or a ``GenerateContentError`` /// error if an error occurred. - @available(macOS 12.0, *) + @available(macOS 12.0, watchOS 8.0, *) public func generateContentStream(_ content: [ModelContent]) throws -> AsyncThrowingStream { try content.throwIfError() @@ -365,7 +364,7 @@ public final class GenerativeModel: Sendable { return response } - @available(macOS 12.0, *) + @available(macOS 12.0, watchOS 8.0, *) func generateContentStream(_ content: [ModelContent], generationConfig: GenerationConfig?) throws -> AsyncThrowingStream { diff --git a/FirebaseAI/Sources/GenerativeModelSession.swift b/FirebaseAI/Sources/GenerativeModelSession.swift index 5a940c7b582..d161112f5fa 100644 --- a/FirebaseAI/Sources/GenerativeModelSession.swift +++ b/FirebaseAI/Sources/GenerativeModelSession.swift @@ -50,7 +50,6 @@ /// print("Bio: \(response.content.bio)") /// print("Favorite Topics: \(response.content.favoriteTopics.joined(separator: ", "))") /// ``` - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public final class GenerativeModelSession: Sendable { let session: Chat @@ -217,6 +216,7 @@ /// - Parameter options: An optional `GenerationConfig` to override the model's default /// generation configuration. /// - Returns: A `ResponseStream` that yields snapshots of the generated content. + @available(macOS 12.0, watchOS 8.0, *) public func streamResponse(to prompt: PartsRepresentable..., options: GenerationConfig? = nil) -> sending GenerativeModelSession.ResponseStream { return streamResponse( @@ -271,6 +271,7 @@ ) } + @available(macOS 12.0, watchOS 8.0, *) private func streamResponse(to prompt: [PartsRepresentable], schema: FirebaseAI.GenerationSchema?, generating type: Content.Type, @@ -438,7 +439,6 @@ // MARK: - Response Types - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public extension GenerativeModelSession { /// The response from a `respond` call. struct Response { @@ -451,7 +451,6 @@ } } - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public extension GenerativeModelSession { /// An asynchronous sequence of snapshots of the model's response. struct ResponseStream: AsyncSequence { @@ -541,7 +540,6 @@ } } - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension GenerativeModelSession.ResponseStream { struct RawResult: Sendable { let rawContent: FirebaseAI.GeneratedContent @@ -639,7 +637,6 @@ } } - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension GenerativeModelSession { enum ErrorCodes: Int { // Generation Errors diff --git a/FirebaseAI/Sources/History.swift b/FirebaseAI/Sources/History.swift index 827f7df5b46..394262fe511 100644 --- a/FirebaseAI/Sources/History.swift +++ b/FirebaseAI/Sources/History.swift @@ -14,7 +14,6 @@ import Foundation -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class History: Sendable { private let historyLock = NSLock() private nonisolated(unsafe) var _history: [ModelContent] = [] diff --git a/FirebaseAI/Sources/JSONValue.swift b/FirebaseAI/Sources/JSONValue.swift index f1333888d27..c12e8aecb0f 100644 --- a/FirebaseAI/Sources/JSONValue.swift +++ b/FirebaseAI/Sources/JSONValue.swift @@ -18,14 +18,12 @@ import Foundation /// /// This may be decoded from, or encoded to, a /// [`google.protobuf.Struct`](https://protobuf.dev/reference/protobuf/google.protobuf/#struct). -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public typealias JSONObject = [String: JSONValue] /// Represents a value in one of JSON's data types. /// /// This may be decoded from, or encoded to, a /// [`google.protobuf.Value`](https://protobuf.dev/reference/protobuf/google.protobuf/#value). -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public enum JSONValue: Sendable { /// A `null` value. case null @@ -46,7 +44,6 @@ public enum JSONValue: Sendable { case array([JSONValue]) } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension JSONValue: Decodable { public init(from decoder: Decoder) throws { let container = try decoder.singleValueContainer() @@ -71,7 +68,6 @@ extension JSONValue: Decodable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension JSONValue: Encodable { public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() @@ -97,5 +93,4 @@ extension JSONValue: Encodable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension JSONValue: Equatable {} diff --git a/FirebaseAI/Sources/ModalityTokenCount.swift b/FirebaseAI/Sources/ModalityTokenCount.swift index e7e36ece21e..fa7f88c37ad 100644 --- a/FirebaseAI/Sources/ModalityTokenCount.swift +++ b/FirebaseAI/Sources/ModalityTokenCount.swift @@ -15,7 +15,6 @@ import Foundation /// Represents token counting info for a single modality. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct ModalityTokenCount: Sendable { /// The modality associated with this token count. public let modality: ContentModality @@ -25,7 +24,6 @@ public struct ModalityTokenCount: Sendable { } /// Content part modality. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct ContentModality: DecodableProtoEnum, Hashable, Sendable { enum Kind: String { case text = "TEXT" @@ -59,7 +57,6 @@ public struct ContentModality: DecodableProtoEnum, Hashable, Sendable { // MARK: Codable Conformances -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension ModalityTokenCount: Decodable { enum CodingKeys: CodingKey { case modality diff --git a/FirebaseAI/Sources/ModelContent.swift b/FirebaseAI/Sources/ModelContent.swift index cfe5b8ac3e5..da1b56e3700 100644 --- a/FirebaseAI/Sources/ModelContent.swift +++ b/FirebaseAI/Sources/ModelContent.swift @@ -14,7 +14,6 @@ import Foundation -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension [ModelContent] { // TODO: Rename and refactor this. func throwIfError() throws { @@ -31,7 +30,6 @@ extension [ModelContent] { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) struct InternalPart: Equatable, Sendable { enum OneOfData: Equatable, Sendable { case text(String) @@ -67,7 +65,6 @@ struct InternalPart: Equatable, Sendable { /// A type describing data in media formats interpretable by an AI model. Each generative AI /// request or response contains an `Array` of ``ModelContent``s, and each ``ModelContent`` value /// may comprise multiple heterogeneous ``Part``s. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct ModelContent: Equatable, Sendable { /// The role of the entity creating the ``ModelContent``. For user-generated client requests, /// for example, the role is `user`. @@ -173,7 +170,6 @@ public struct ModelContent: Equatable, Sendable { // MARK: Codable Conformances -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension ModelContent: Codable { enum CodingKeys: String, CodingKey { case role @@ -187,7 +183,6 @@ extension ModelContent: Codable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension InternalPart: Codable { enum CodingKeys: String, CodingKey { case isThought = "thought" @@ -216,7 +211,6 @@ extension InternalPart: Codable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension InternalPart.OneOfData: Codable { enum CodingKeys: String, CodingKey { case text diff --git a/FirebaseAI/Sources/PartsRepresentable+Image.swift b/FirebaseAI/Sources/PartsRepresentable+Image.swift index 5bedeb8f3d1..8ac5546aef1 100644 --- a/FirebaseAI/Sources/PartsRepresentable+Image.swift +++ b/FirebaseAI/Sources/PartsRepresentable+Image.swift @@ -37,7 +37,6 @@ enum ImageConversionError: Error { #if canImport(UIKit) /// Enables images to be representable as ``PartsRepresentable``. - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension UIImage: PartsRepresentable { public var partsValue: [any Part] { guard let data = jpegData(compressionQuality: imageCompressionQuality) else { @@ -49,7 +48,6 @@ enum ImageConversionError: Error { #elseif canImport(AppKit) /// Enables images to be representable as ``PartsRepresentable``. - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension NSImage: PartsRepresentable { public var partsValue: [any Part] { guard let cgImage = cgImage(forProposedRect: nil, context: nil, hints: nil) else { @@ -67,12 +65,16 @@ enum ImageConversionError: Error { #if !os(watchOS) // This code does not build on watchOS. /// Enables `CGImages` to be representable as model content. - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) extension CGImage: PartsRepresentable { public var partsValue: [any Part] { let output = NSMutableData() + let jpegIdentifier = if #available(macOS 11.0, *) { + UTType.jpeg.identifier + } else { + "public.jpeg" + } guard let imageDestination = CGImageDestinationCreateWithData( - output, UTType.jpeg.identifier as CFString, 1, nil + output, jpegIdentifier as CFString, 1, nil ) else { return [ErrorPart(ImageConversionError.couldNotAllocateDestination)] } @@ -90,7 +92,6 @@ enum ImageConversionError: Error { #if canImport(CoreImage) /// Enables `CIImages` to be representable as model content. - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) extension CIImage: PartsRepresentable { public var partsValue: [any Part] { let context = CIContext() diff --git a/FirebaseAI/Sources/PartsRepresentable.swift b/FirebaseAI/Sources/PartsRepresentable.swift index 82d0688df38..24cef0b5d6a 100644 --- a/FirebaseAI/Sources/PartsRepresentable.swift +++ b/FirebaseAI/Sources/PartsRepresentable.swift @@ -16,13 +16,11 @@ import Foundation /// A protocol describing any data that could be serialized to model-interpretable input data, /// where the serialization process cannot fail with an error. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public protocol PartsRepresentable { var partsValue: [any Part] { get } } /// Enables a ``Part`` to be used as a ``PartsRepresentable``. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public extension Part { var partsValue: [any Part] { return [self] @@ -31,7 +29,6 @@ public extension Part { /// Enable an `Array` of ``PartsRepresentable`` values to be passed in as a single /// ``PartsRepresentable``. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension [PartsRepresentable]: PartsRepresentable { public var partsValue: [any Part] { return flatMap { $0.partsValue } @@ -39,7 +36,6 @@ extension [PartsRepresentable]: PartsRepresentable { } /// Enables a `String` to be passed in as ``PartsRepresentable``. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension String: PartsRepresentable { public var partsValue: [any Part] { return [TextPart(self)] diff --git a/FirebaseAI/Sources/Protocols/Public/ConvertibleFromGeneratedContent.swift b/FirebaseAI/Sources/Protocols/Public/ConvertibleFromGeneratedContent.swift index ad922156f17..75b638d634c 100644 --- a/FirebaseAI/Sources/Protocols/Public/ConvertibleFromGeneratedContent.swift +++ b/FirebaseAI/Sources/Protocols/Public/ConvertibleFromGeneratedContent.swift @@ -13,14 +13,12 @@ // limitations under the License. #if compiler(>=6.2) - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension FirebaseAI { protocol ConvertibleFromGeneratedContent { init(_ content: FirebaseAI.GeneratedContent) throws } } - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension String: FirebaseAI.ConvertibleFromGeneratedContent { init(_ content: FirebaseAI.GeneratedContent) throws { guard case let .string(value) = content.kind else { diff --git a/FirebaseAI/Sources/Safety.swift b/FirebaseAI/Sources/Safety.swift index a116089a7cd..32b5c3a1eb0 100644 --- a/FirebaseAI/Sources/Safety.swift +++ b/FirebaseAI/Sources/Safety.swift @@ -17,7 +17,6 @@ import Foundation /// A type defining potentially harmful media categories and their model-assigned ratings. A value /// of this type may be assigned to a category for every model-generated response, not just /// responses that exceed a certain threshold. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct SafetyRating: Equatable, Hashable, Sendable { /// The category describing the potential harm a piece of content may pose. /// @@ -75,7 +74,6 @@ public struct SafetyRating: Equatable, Hashable, Sendable { /// The probability that a given model output falls under a harmful content category. /// /// > Note: This does not indicate the severity of harm for a piece of content. - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct HarmProbability: DecodableProtoEnum, Hashable, Sendable { enum Kind: String { case unspecified = "HARM_PROBABILITY_UNSPECIFIED" @@ -115,7 +113,6 @@ public struct SafetyRating: Equatable, Hashable, Sendable { } /// The magnitude of how harmful a model response might be for the respective ``HarmCategory``. - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct HarmSeverity: DecodableProtoEnum, Hashable, Sendable { enum Kind: String { case unspecified = "HARM_SEVERITY_UNSPECIFIED" @@ -157,7 +154,6 @@ public struct SafetyRating: Equatable, Hashable, Sendable { /// See [safety settings for Gemini /// models](https://firebase.google.com/docs/vertex-ai/safety-settings?platform=ios#gemini) for /// more details. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct SafetySetting: Sendable { /// Block at and beyond a specified ``SafetyRating/HarmProbability``. public struct HarmBlockThreshold: EncodableProtoEnum, Sendable { @@ -188,7 +184,6 @@ public struct SafetySetting: Sendable { } /// The method of computing whether the ``SafetySetting/HarmBlockThreshold`` has been exceeded. - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct HarmBlockMethod: EncodableProtoEnum, Sendable { enum Kind: String { case severity = "SEVERITY" @@ -239,7 +234,6 @@ public struct SafetySetting: Sendable { } /// Categories describing the potential harm a piece of content may pose. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct HarmCategory: CodableProtoEnum, Hashable, Sendable { enum Kind: String { case unspecified = "HARM_CATEGORY_UNSPECIFIED" @@ -280,7 +274,6 @@ public struct HarmCategory: CodableProtoEnum, Hashable, Sendable { // MARK: - Codable Conformances -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension SafetyRating: Decodable { enum CodingKeys: CodingKey { case category @@ -308,8 +301,6 @@ extension SafetyRating: Decodable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension SafetySetting.HarmBlockThreshold: Encodable {} -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension SafetySetting: Encodable {} diff --git a/FirebaseAI/Sources/TemplateChatSession.swift b/FirebaseAI/Sources/TemplateChatSession.swift index abba669a1dd..27ceed8a0b4 100644 --- a/FirebaseAI/Sources/TemplateChatSession.swift +++ b/FirebaseAI/Sources/TemplateChatSession.swift @@ -19,7 +19,6 @@ import Foundation /// A chat session that allows for conversation with a model. /// /// **Public Preview**: This API is a public preview and may be subject to change. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class TemplateChatSession: Sendable { private let model: TemplateGenerativeModel private let templateID: String @@ -102,6 +101,7 @@ final class TemplateChatSession: Sendable { /// request timeout. /// - Returns: An `AsyncThrowingStream` that yields `GenerateContentResponse` objects. /// - Throws: A ``GenerateContentError`` if the request failed. + @available(macOS 12.0, watchOS 8.0, *) func sendMessageStream(_ content: [ModelContent], inputs: [String: Any], options: RequestOptions = RequestOptions()) throws @@ -157,6 +157,7 @@ final class TemplateChatSession: Sendable { /// request timeout. /// - Returns: An `AsyncThrowingStream` that yields `GenerateContentResponse` objects. /// - Throws: A ``GenerateContentError`` if the request failed. + @available(macOS 12.0, watchOS 8.0, *) func sendMessageStream(_ message: any PartsRepresentable, inputs: [String: Any], options: RequestOptions = RequestOptions()) throws diff --git a/FirebaseAI/Sources/TemplateGenerateContentRequest.swift b/FirebaseAI/Sources/TemplateGenerateContentRequest.swift index 20ba84b3571..92e451ef30d 100644 --- a/FirebaseAI/Sources/TemplateGenerateContentRequest.swift +++ b/FirebaseAI/Sources/TemplateGenerateContentRequest.swift @@ -14,7 +14,6 @@ import Foundation -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) struct TemplateGenerateContentRequest: Sendable { let template: String let inputs: [String: TemplateInput] @@ -25,7 +24,6 @@ struct TemplateGenerateContentRequest: Sendable { let options: RequestOptions } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension TemplateGenerateContentRequest: Encodable { enum CodingKeys: String, CodingKey { case inputs @@ -39,7 +37,6 @@ extension TemplateGenerateContentRequest: Encodable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension TemplateGenerateContentRequest: GenerativeAIRequest { typealias Response = GenerateContentResponse diff --git a/FirebaseAI/Sources/TemplateGenerativeModel.swift b/FirebaseAI/Sources/TemplateGenerativeModel.swift index bf727021c0f..3716b52c538 100644 --- a/FirebaseAI/Sources/TemplateGenerativeModel.swift +++ b/FirebaseAI/Sources/TemplateGenerativeModel.swift @@ -18,7 +18,6 @@ import Foundation /// content based on various input types. /// /// **Public Preview**: This API is a public preview and may be subject to change. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public final class TemplateGenerativeModel: Sendable { let generativeAIService: GenerativeAIService let apiConfig: APIConfig @@ -89,6 +88,7 @@ public final class TemplateGenerativeModel: Sendable { /// request timeout. /// - Returns: An `AsyncThrowingStream` that yields `GenerateContentResponse` objects. /// - Throws: A ``GenerateContentError`` if the request failed. + @available(macOS 12.0, watchOS 8.0, *) public func generateContentStream(templateID: String, inputs: [String: Any], options: RequestOptions = RequestOptions()) throws @@ -106,6 +106,7 @@ public final class TemplateGenerativeModel: Sendable { return generativeAIService.loadRequestStream(request: request) } + @available(macOS 12.0, watchOS 8.0, *) func generateContentStreamWithHistory(history: [ModelContent], template: String, inputs: [String: TemplateInput], options: RequestOptions = RequestOptions()) throws diff --git a/FirebaseAI/Sources/TemplateImagenGenerationRequest.swift b/FirebaseAI/Sources/TemplateImagenGenerationRequest.swift index c155b66fe55..aa88392fd37 100644 --- a/FirebaseAI/Sources/TemplateImagenGenerationRequest.swift +++ b/FirebaseAI/Sources/TemplateImagenGenerationRequest.swift @@ -18,7 +18,6 @@ enum ImageAPIMethod: String { case generateImages = "templatePredict" } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) struct TemplateImagenGenerationRequest: Sendable { typealias Response = ImagenGenerationResponse @@ -38,7 +37,6 @@ struct TemplateImagenGenerationRequest: Sen } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension TemplateImagenGenerationRequest: GenerativeAIRequest where ImageType: Decodable { func getURL() throws -> URL { var urlString = @@ -54,7 +52,6 @@ extension TemplateImagenGenerationRequest: GenerativeAIRequest where ImageType: } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension TemplateImagenGenerationRequest: Encodable { enum CodingKeys: String, CodingKey { case inputs diff --git a/FirebaseAI/Sources/TemplateImagenModel.swift b/FirebaseAI/Sources/TemplateImagenModel.swift index b8cfcb9a9cb..83c62a40dcf 100644 --- a/FirebaseAI/Sources/TemplateImagenModel.swift +++ b/FirebaseAI/Sources/TemplateImagenModel.swift @@ -19,7 +19,6 @@ import Foundation /// images based on various input types. /// /// **Public Preview**: This API is a public preview and may be subject to change. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public final class TemplateImagenModel: Sendable { let generativeAIService: GenerativeAIService let apiConfig: APIConfig diff --git a/FirebaseAI/Sources/Tool.swift b/FirebaseAI/Sources/Tool.swift index 53e0ee8b49e..dda4dd1e1ea 100644 --- a/FirebaseAI/Sources/Tool.swift +++ b/FirebaseAI/Sources/Tool.swift @@ -18,7 +18,6 @@ import Foundation /// /// This `FunctionDeclaration` is a representation of a block of code that can be used as a ``Tool`` /// by the model and executed by the client. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct FunctionDeclaration: Sendable { /// The name of the function. let name: String @@ -58,7 +57,6 @@ public struct FunctionDeclaration: Sendable { /// [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) /// or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) /// section within the Service Specific Terms). -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct GoogleSearch: Sendable { public init() {} } @@ -67,7 +65,6 @@ public struct GoogleSearch: Sendable { /// /// A `Tool` is a piece of code that enables the system to interact with external systems to perform /// an action, or set of actions, outside of knowledge and scope of the model. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct Tool: Sendable { /// A list of `FunctionDeclarations` available to the model. let functionDeclarations: [FunctionDeclaration]? @@ -149,7 +146,6 @@ public struct Tool: Sendable { } /// Configuration for specifying function calling behavior. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct FunctionCallingConfig: Sendable { /// Defines the execution behavior for function calling by defining the execution mode. enum Mode: String { @@ -195,7 +191,6 @@ public struct FunctionCallingConfig: Sendable { } /// Tool configuration for any `Tool` specified in the request. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct ToolConfig: Sendable { let functionCallingConfig: FunctionCallingConfig? @@ -206,7 +201,6 @@ public struct ToolConfig: Sendable { // MARK: - Codable Conformance -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension FunctionDeclaration: Encodable { enum CodingKeys: String, CodingKey { case name @@ -222,17 +216,12 @@ extension FunctionDeclaration: Encodable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension Tool: Encodable {} -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension FunctionCallingConfig: Encodable {} -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension FunctionCallingConfig.Mode: Encodable {} -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension GoogleSearch: Encodable {} -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension ToolConfig: Encodable {} diff --git a/FirebaseAI/Sources/Types/Internal/Errors/EmptyContentError.swift b/FirebaseAI/Sources/Types/Internal/Errors/EmptyContentError.swift index 7c33a975c18..85e2660a59c 100644 --- a/FirebaseAI/Sources/Types/Internal/Errors/EmptyContentError.swift +++ b/FirebaseAI/Sources/Types/Internal/Errors/EmptyContentError.swift @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension Candidate { struct EmptyContentError: Error { let localizedDescription = "Invalid Candidate: empty content and no finish reason" diff --git a/FirebaseAI/Sources/Types/Internal/Imagen/ImageGenerationInstance.swift b/FirebaseAI/Sources/Types/Internal/Imagen/ImageGenerationInstance.swift index c1d853643cc..b43eef12f03 100644 --- a/FirebaseAI/Sources/Types/Internal/Imagen/ImageGenerationInstance.swift +++ b/FirebaseAI/Sources/Types/Internal/Imagen/ImageGenerationInstance.swift @@ -12,15 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) struct ImageGenerationInstance { let prompt: String } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension ImageGenerationInstance: Equatable {} // MARK: - Codable Conformance -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension ImageGenerationInstance: Encodable {} diff --git a/FirebaseAI/Sources/Types/Internal/Imagen/ImageGenerationOutputOptions.swift b/FirebaseAI/Sources/Types/Internal/Imagen/ImageGenerationOutputOptions.swift index 0b678187ee2..8098bae36f0 100644 --- a/FirebaseAI/Sources/Types/Internal/Imagen/ImageGenerationOutputOptions.swift +++ b/FirebaseAI/Sources/Types/Internal/Imagen/ImageGenerationOutputOptions.swift @@ -14,16 +14,13 @@ import Foundation -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) struct ImageGenerationOutputOptions { let mimeType: String let compressionQuality: Int? } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension ImageGenerationOutputOptions: Equatable {} // MARK: - Codable Conformance -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension ImageGenerationOutputOptions: Encodable {} diff --git a/FirebaseAI/Sources/Types/Internal/Imagen/ImageGenerationParameters.swift b/FirebaseAI/Sources/Types/Internal/Imagen/ImageGenerationParameters.swift index aa1e1b085c8..5e4ee267e63 100644 --- a/FirebaseAI/Sources/Types/Internal/Imagen/ImageGenerationParameters.swift +++ b/FirebaseAI/Sources/Types/Internal/Imagen/ImageGenerationParameters.swift @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) struct ImageGenerationParameters { let sampleCount: Int? let storageURI: String? @@ -26,12 +25,10 @@ struct ImageGenerationParameters { let includeSafetyAttributes: Bool? } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension ImageGenerationParameters: Equatable {} // MARK: - Codable Conformance -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension ImageGenerationParameters: Encodable { enum CodingKeys: String, CodingKey { case sampleCount diff --git a/FirebaseAI/Sources/Types/Internal/Imagen/ImagenGCSImage.swift b/FirebaseAI/Sources/Types/Internal/Imagen/ImagenGCSImage.swift index 030fe76c681..c94227caa3f 100644 --- a/FirebaseAI/Sources/Types/Internal/Imagen/ImagenGCSImage.swift +++ b/FirebaseAI/Sources/Types/Internal/Imagen/ImagenGCSImage.swift @@ -17,7 +17,6 @@ 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, *) struct ImagenGCSImage: Sendable { /// The IANA standard MIME type of the image file; either `"image/png"` or `"image/jpeg"`. /// @@ -36,7 +35,6 @@ struct ImagenGCSImage: Sendable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension ImagenGCSImage: ImagenImageRepresentable { // TODO(andrewheard): Make this public when the SDK supports Imagen operations that take images as // input (upscaling / editing). @@ -45,12 +43,10 @@ extension ImagenGCSImage: ImagenImageRepresentable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension ImagenGCSImage: Equatable {} // MARK: - Codable Conformances -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension ImagenGCSImage: Decodable { enum CodingKeys: String, CodingKey { case mimeType diff --git a/FirebaseAI/Sources/Types/Internal/Imagen/ImagenGenerationRequest.swift b/FirebaseAI/Sources/Types/Internal/Imagen/ImagenGenerationRequest.swift index 9f5a76137d3..06954a06fec 100644 --- a/FirebaseAI/Sources/Types/Internal/Imagen/ImagenGenerationRequest.swift +++ b/FirebaseAI/Sources/Types/Internal/Imagen/ImagenGenerationRequest.swift @@ -14,7 +14,6 @@ import Foundation -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) struct ImagenGenerationRequest: Sendable { let model: String let apiConfig: APIConfig @@ -35,7 +34,6 @@ struct ImagenGenerationRequest: Sendable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension ImagenGenerationRequest: GenerativeAIRequest where ImageType: Decodable { typealias Response = ImagenGenerationResponse @@ -49,7 +47,6 @@ extension ImagenGenerationRequest: GenerativeAIRequest where ImageType: Decodabl } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension ImagenGenerationRequest: Encodable { enum CodingKeys: CodingKey { case instances diff --git a/FirebaseAI/Sources/Types/Internal/Imagen/ImagenImageRepresentable.swift b/FirebaseAI/Sources/Types/Internal/Imagen/ImagenImageRepresentable.swift index 1c53eb0f9b6..cd86a19b7aa 100644 --- a/FirebaseAI/Sources/Types/Internal/Imagen/ImagenImageRepresentable.swift +++ b/FirebaseAI/Sources/Types/Internal/Imagen/ImagenImageRepresentable.swift @@ -16,7 +16,6 @@ import Foundation // TODO(andrewheard): Make this public when the SDK supports Imagen operations that take images as // input (upscaling / editing). -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) protocol ImagenImageRepresentable: Sendable { /// Internal representation of the image for use with the Imagen model. /// diff --git a/FirebaseAI/Sources/Types/Internal/Imagen/ImagenSafetyAttributes.swift b/FirebaseAI/Sources/Types/Internal/Imagen/ImagenSafetyAttributes.swift index 3dcb93d544a..69e081514c9 100644 --- a/FirebaseAI/Sources/Types/Internal/Imagen/ImagenSafetyAttributes.swift +++ b/FirebaseAI/Sources/Types/Internal/Imagen/ImagenSafetyAttributes.swift @@ -18,7 +18,6 @@ import Foundation /// /// This prediction is currently unused by the SDK and is only checked to be valid JSON. This type /// is currently only used to avoid logging unsupported prediction types. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) struct ImagenSafetyAttributes: Decodable { let safetyAttributes: JSONObject } diff --git a/FirebaseAI/Sources/Types/Internal/Imagen/InternalImagenImage.swift b/FirebaseAI/Sources/Types/Internal/Imagen/InternalImagenImage.swift index 76b668b6981..12373ec47f7 100644 --- a/FirebaseAI/Sources/Types/Internal/Imagen/InternalImagenImage.swift +++ b/FirebaseAI/Sources/Types/Internal/Imagen/InternalImagenImage.swift @@ -21,7 +21,6 @@ import Foundation /// /// TODO(andrewheard): Make this public when the SDK supports Imagen operations that take images as /// input (upscaling / editing). -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) struct _InternalImagenImage { let mimeType: String let bytesBase64Encoded: String? diff --git a/FirebaseAI/Sources/Types/Internal/Imagen/RAIFilteredReason.swift b/FirebaseAI/Sources/Types/Internal/Imagen/RAIFilteredReason.swift index d1bb64da9cc..1aa68c79cb6 100644 --- a/FirebaseAI/Sources/Types/Internal/Imagen/RAIFilteredReason.swift +++ b/FirebaseAI/Sources/Types/Internal/Imagen/RAIFilteredReason.swift @@ -12,12 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) struct RAIFilteredReason { let raiFilteredReason: String } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension RAIFilteredReason: Decodable { enum CodingKeys: CodingKey { case raiFilteredReason diff --git a/FirebaseAI/Sources/Types/Internal/InternalPart.swift b/FirebaseAI/Sources/Types/Internal/InternalPart.swift index a9d5a2eb810..dd9bb9bf55b 100644 --- a/FirebaseAI/Sources/Types/Internal/InternalPart.swift +++ b/FirebaseAI/Sources/Types/Internal/InternalPart.swift @@ -14,7 +14,6 @@ import Foundation -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) struct InlineData: Codable, Equatable, Sendable { let mimeType: String let data: Data @@ -25,7 +24,6 @@ struct InlineData: Codable, Equatable, Sendable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) struct FileData: Codable, Equatable, Sendable { let fileURI: String let mimeType: String @@ -41,7 +39,6 @@ struct FileData: Codable, Equatable, Sendable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) struct FunctionCall: Equatable, Sendable { let name: String let args: JSONObject @@ -54,7 +51,6 @@ struct FunctionCall: Equatable, Sendable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) struct FunctionResponse: Codable, Equatable, Sendable { let name: String let response: JSONObject @@ -67,7 +63,6 @@ struct FunctionResponse: Codable, Equatable, Sendable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) struct ExecutableCode: Codable, Equatable, Sendable { struct Language: CodableProtoEnum, Sendable, Equatable { enum Kind: String { @@ -90,7 +85,6 @@ struct ExecutableCode: Codable, Equatable, Sendable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) struct CodeExecutionResult: Codable, Equatable, Sendable { struct Outcome: CodableProtoEnum, Sendable, Equatable { enum Kind: String { @@ -115,7 +109,6 @@ struct CodeExecutionResult: Codable, Equatable, Sendable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) struct ErrorPart: Part, Error { let error: Error @@ -129,7 +122,6 @@ struct ErrorPart: Part, Error { // MARK: - Codable Conformances -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension FunctionCall: Codable { init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) @@ -143,7 +135,6 @@ extension FunctionCall: Codable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension ErrorPart: Codable { init(from decoder: any Decoder) throws { fatalError("Decoding an ErrorPart is not supported.") @@ -156,7 +147,6 @@ extension ErrorPart: Codable { // MARK: - Equatable Conformances -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension ErrorPart: Equatable { static func == (lhs: ErrorPart, rhs: ErrorPart) -> Bool { fatalError("Comparing ErrorParts for equality is not supported.") diff --git a/FirebaseAI/Sources/Types/Internal/Live/AsyncWebSocket.swift b/FirebaseAI/Sources/Types/Internal/Live/AsyncWebSocket.swift index 81c1c337258..38503be2ef5 100644 --- a/FirebaseAI/Sources/Types/Internal/Live/AsyncWebSocket.swift +++ b/FirebaseAI/Sources/Types/Internal/Live/AsyncWebSocket.swift @@ -21,7 +21,6 @@ private import FirebaseCoreInternal /// friendly interface for sending and consuming data from it. /// /// Also surfaces a more fine-grained ``WebSocketClosedError`` for when the web socket is closed. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) final class AsyncWebSocket: Sendable { private let webSocketTask: URLSessionWebSocketTask diff --git a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentClientContent.swift b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentClientContent.swift index 459aa258cc3..7f97fdc4cad 100644 --- a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentClientContent.swift +++ b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentClientContent.swift @@ -19,7 +19,6 @@ import Foundation /// history and used as part of the prompt to the model to generate content. /// /// A message here will interrupt any current model generation. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) struct BidiGenerateContentClientContent: Encodable { /// The content appended to the current conversation with the model. diff --git a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentClientMessage.swift b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentClientMessage.swift index 758d75e2cc7..0b25c7b4e25 100644 --- a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentClientMessage.swift +++ b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentClientMessage.swift @@ -15,7 +15,6 @@ import Foundation /// Messages sent by the client in the BidiGenerateContent RPC call. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) enum BidiGenerateContentClientMessage { /// Message to be sent in the first and only first client message. @@ -31,7 +30,6 @@ enum BidiGenerateContentClientMessage { case toolResponse(BidiGenerateContentToolResponse) } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) extension BidiGenerateContentClientMessage: Encodable { enum CodingKeys: CodingKey { diff --git a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentRealtimeInput.swift b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentRealtimeInput.swift index 753a9a3fb15..a2bdb7cb481 100644 --- a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentRealtimeInput.swift +++ b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentRealtimeInput.swift @@ -28,7 +28,6 @@ import Foundation /// to optimize for a fast start of the response from the model. /// - Is always assumed to be the user's input (cannot be used to populate /// conversation history). -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) struct BidiGenerateContentRealtimeInput: Encodable { /// These form the realtime audio input stream. diff --git a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentServerContent.swift b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentServerContent.swift index 648d7a09ed8..d765be9169b 100644 --- a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentServerContent.swift +++ b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentServerContent.swift @@ -19,7 +19,6 @@ import Foundation /// /// Content is generated as quickly as possible, and not in realtime. Clients /// may choose to buffer and play it out in realtime. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) struct BidiGenerateContentServerContent: Decodable, Sendable { /// The content that the model has generated as part of the current diff --git a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentServerMessage.swift b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentServerMessage.swift index 8c7c628ebdb..23389b53142 100644 --- a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentServerMessage.swift +++ b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentServerMessage.swift @@ -15,7 +15,6 @@ import Foundation /// Response message for BidiGenerateContent RPC call. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) @available(watchOS, unavailable) struct BidiGenerateContentServerMessage: Sendable { /// The type of the message. @@ -48,7 +47,6 @@ struct BidiGenerateContentServerMessage: Sendable { // MARK: - Decodable -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) @available(watchOS, unavailable) extension BidiGenerateContentServerMessage: Decodable { enum CodingKeys: String, CodingKey { diff --git a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentSetup.swift b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentSetup.swift index 15dc8889a0b..96a4082a599 100644 --- a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentSetup.swift +++ b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentSetup.swift @@ -20,7 +20,6 @@ import Foundation /// /// Clients should wait for a `BidiGenerateContentSetupComplete` message before /// sending any additional messages. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) struct BidiGenerateContentSetup: Encodable { /// The fully qualified name of the publisher model. @@ -73,6 +72,5 @@ struct BidiGenerateContentSetup: Encodable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) struct BidiAudioTranscriptionConfig: Encodable {} diff --git a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentSetupComplete.swift b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentSetupComplete.swift index 54449782060..5207ec81b72 100644 --- a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentSetupComplete.swift +++ b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentSetupComplete.swift @@ -15,6 +15,5 @@ import Foundation /// Sent in response to a `BidiGenerateContentSetup` message from the client. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) struct BidiGenerateContentSetupComplete: Decodable, Sendable {} diff --git a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentToolCall.swift b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentToolCall.swift index 4c34e6367e9..cd124ca2948 100644 --- a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentToolCall.swift +++ b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentToolCall.swift @@ -16,7 +16,6 @@ import Foundation /// Request for the client to execute the `function_calls` and return the /// responses with the matching `id`s. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) struct BidiGenerateContentToolCall: Decodable, Sendable { /// The function call to be executed. diff --git a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentToolCallCancellation.swift b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentToolCallCancellation.swift index 48bc991c1fa..0c334df05d3 100644 --- a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentToolCallCancellation.swift +++ b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentToolCallCancellation.swift @@ -19,7 +19,6 @@ import Foundation /// cancelled. If there were side-effects to those tool calls, clients may /// attempt to undo the tool calls. This message occurs only in cases where the /// clients interrupt server turns. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) struct BidiGenerateContentToolCallCancellation: Decodable, Sendable { /// The ids of the tool calls to be cancelled. diff --git a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentToolResponse.swift b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentToolResponse.swift index c9d2506895b..7950fc8c68a 100644 --- a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentToolResponse.swift +++ b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentToolResponse.swift @@ -22,7 +22,6 @@ import Foundation /// calling happens by exchanging the `Content` parts, while in the bidi /// GenerateContent APIs function calling happens over these dedicated set of /// messages. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) struct BidiGenerateContentToolResponse: Encodable { /// The response to the function calls. diff --git a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentTranscription.swift b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentTranscription.swift index 652799edf9d..390d308d7f6 100644 --- a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentTranscription.swift +++ b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerateContentTranscription.swift @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) struct BidiGenerateContentTranscription: Decodable, Sendable { let text: String? diff --git a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerationConfig.swift b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerationConfig.swift index a3a3e8a9f99..4834101ffb3 100644 --- a/FirebaseAI/Sources/Types/Internal/Live/BidiGenerationConfig.swift +++ b/FirebaseAI/Sources/Types/Internal/Live/BidiGenerationConfig.swift @@ -15,7 +15,6 @@ import Foundation /// Configuration options for live content generation. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) struct BidiGenerationConfig: Encodable, Sendable { let temperature: Float? diff --git a/FirebaseAI/Sources/Types/Internal/Live/BidiSpeechConfig.swift b/FirebaseAI/Sources/Types/Internal/Live/BidiSpeechConfig.swift index 80e7d341ef7..f3ab6bbe449 100644 --- a/FirebaseAI/Sources/Types/Internal/Live/BidiSpeechConfig.swift +++ b/FirebaseAI/Sources/Types/Internal/Live/BidiSpeechConfig.swift @@ -15,7 +15,6 @@ import Foundation /// Speech generation config. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) struct BidiSpeechConfig: Encodable, Sendable { /// The configuration for the speaker to use. diff --git a/FirebaseAI/Sources/Types/Internal/Live/GoAway.swift b/FirebaseAI/Sources/Types/Internal/Live/GoAway.swift index f5c858b8b45..e8076c3945e 100644 --- a/FirebaseAI/Sources/Types/Internal/Live/GoAway.swift +++ b/FirebaseAI/Sources/Types/Internal/Live/GoAway.swift @@ -15,7 +15,6 @@ import Foundation /// Server will not be able to service client soon. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) struct GoAway: Decodable, Sendable { /// The remaining time before the connection will be terminated as ABORTED. diff --git a/FirebaseAI/Sources/Types/Internal/Live/LiveSessionService.swift b/FirebaseAI/Sources/Types/Internal/Live/LiveSessionService.swift index a2fd31b34e9..60c143cbc2b 100644 --- a/FirebaseAI/Sources/Types/Internal/Live/LiveSessionService.swift +++ b/FirebaseAI/Sources/Types/Internal/Live/LiveSessionService.swift @@ -28,7 +28,6 @@ import Foundation /// /// This mainly comes into play when we don't want to block developers from sending messages while a /// session is being reloaded. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) @available(watchOS, unavailable) actor LiveSessionService { let responses: AsyncThrowingStream diff --git a/FirebaseAI/Sources/Types/Internal/Live/VoiceConfig.swift b/FirebaseAI/Sources/Types/Internal/Live/VoiceConfig.swift index 0e6790c03f2..07c38ed6f5c 100644 --- a/FirebaseAI/Sources/Types/Internal/Live/VoiceConfig.swift +++ b/FirebaseAI/Sources/Types/Internal/Live/VoiceConfig.swift @@ -15,7 +15,6 @@ import Foundation /// Configuration for the speaker to use. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) enum VoiceConfig { /// Configuration for the prebuilt voice to use. @@ -29,7 +28,6 @@ enum VoiceConfig { /// /// Not just a string on the parent proto, because there'll likely be a lot /// more options here. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) struct PrebuiltVoiceConfig: Encodable, Sendable { /// The name of the preset voice to use. @@ -41,7 +39,6 @@ struct PrebuiltVoiceConfig: Encodable, Sendable { } /// The configuration for the custom voice to use. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) struct CustomVoiceConfig: Encodable, Sendable { /// The sample of the custom voice, in pcm16 s16e format. @@ -54,7 +51,6 @@ struct CustomVoiceConfig: Encodable, Sendable { // MARK: - Encodable conformance -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) extension VoiceConfig: Encodable { enum CodingKeys: CodingKey { diff --git a/FirebaseAI/Sources/Types/Internal/Requests/CountTokensRequest.swift b/FirebaseAI/Sources/Types/Internal/Requests/CountTokensRequest.swift index be3e09c3060..3fb46272727 100644 --- a/FirebaseAI/Sources/Types/Internal/Requests/CountTokensRequest.swift +++ b/FirebaseAI/Sources/Types/Internal/Requests/CountTokensRequest.swift @@ -14,14 +14,12 @@ import Foundation -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) struct CountTokensRequest { let modelResourceName: String let generateContentRequest: GenerateContentRequest } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension CountTokensRequest: GenerativeAIRequest { typealias Response = CountTokensResponse @@ -41,7 +39,6 @@ extension CountTokensRequest: GenerativeAIRequest { } /// The model's response to a count tokens request. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct CountTokensResponse: Sendable { /// The total number of tokens in the input given to the model as a prompt. public let totalTokens: Int @@ -52,7 +49,6 @@ public struct CountTokensResponse: Sendable { // MARK: - Codable Conformances -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension CountTokensRequest: Encodable { enum VertexCodingKeys: CodingKey { case contents @@ -92,7 +88,6 @@ extension CountTokensRequest: Encodable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension CountTokensResponse: Decodable { enum CodingKeys: CodingKey { case totalTokens diff --git a/FirebaseAI/Sources/Types/Internal/Tools/URLContext.swift b/FirebaseAI/Sources/Types/Internal/Tools/URLContext.swift index 2033bb940f1..faebc4a263f 100644 --- a/FirebaseAI/Sources/Types/Internal/Tools/URLContext.swift +++ b/FirebaseAI/Sources/Types/Internal/Tools/URLContext.swift @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) struct URLContext: Sendable, Encodable { init() {} } diff --git a/FirebaseAI/Sources/Types/Public/Imagen/ImagenAspectRatio.swift b/FirebaseAI/Sources/Types/Public/Imagen/ImagenAspectRatio.swift index a7e9fd905f0..c6357db43e0 100644 --- a/FirebaseAI/Sources/Types/Public/Imagen/ImagenAspectRatio.swift +++ b/FirebaseAI/Sources/Types/Public/Imagen/ImagenAspectRatio.swift @@ -20,7 +20,6 @@ import Foundation /// your ``ImagenGenerationConfig``. See the [Cloud /// documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/image/generate-images#aspect-ratio) /// for more details and examples of the supported aspect ratios. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct ImagenAspectRatio: Sendable { /// Square (1:1) aspect ratio. /// @@ -58,7 +57,6 @@ public struct ImagenAspectRatio: Sendable { let rawValue: String } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension ImagenAspectRatio: ProtoEnum { enum Kind: String { case square1x1 = "1:1" diff --git a/FirebaseAI/Sources/Types/Public/Imagen/ImagenGenerationConfig.swift b/FirebaseAI/Sources/Types/Public/Imagen/ImagenGenerationConfig.swift index 66623aeedf1..4f91364a597 100644 --- a/FirebaseAI/Sources/Types/Public/Imagen/ImagenGenerationConfig.swift +++ b/FirebaseAI/Sources/Types/Public/Imagen/ImagenGenerationConfig.swift @@ -17,7 +17,6 @@ /// See [Parameters for Imagen /// models](https://firebase.google.com/docs/vertex-ai/model-parameters?platform=ios#imagen) to /// learn about parameters available for use with Imagen models, including how to configure them. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct ImagenGenerationConfig { /// Specifies elements to exclude from the generated image. /// diff --git a/FirebaseAI/Sources/Types/Public/Imagen/ImagenGenerationResponse.swift b/FirebaseAI/Sources/Types/Public/Imagen/ImagenGenerationResponse.swift index 9ed52c4d0e9..fe3e5b4f41d 100644 --- a/FirebaseAI/Sources/Types/Public/Imagen/ImagenGenerationResponse.swift +++ b/FirebaseAI/Sources/Types/Public/Imagen/ImagenGenerationResponse.swift @@ -20,7 +20,6 @@ import Foundation /// /// This type is returned from: /// - ``ImagenModel/generateImages(prompt:)`` where `T` is ``ImagenInlineImage`` -@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: Sendable where T: Sendable { @@ -43,7 +42,6 @@ public struct ImagenGenerationResponse: Sendable where T: Sendable { // MARK: - Codable Conformances -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension ImagenGenerationResponse: Decodable where T: Decodable { enum CodingKeys: CodingKey { case predictions diff --git a/FirebaseAI/Sources/Types/Public/Imagen/ImagenImageFormat.swift b/FirebaseAI/Sources/Types/Public/Imagen/ImagenImageFormat.swift index 9ae6af3c6ac..449f321b7fa 100644 --- a/FirebaseAI/Sources/Types/Public/Imagen/ImagenImageFormat.swift +++ b/FirebaseAI/Sources/Types/Public/Imagen/ImagenImageFormat.swift @@ -20,7 +20,6 @@ import Foundation /// your ``ImagenGenerationConfig``. See the [Cloud /// documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/imagen-api#output-options) /// for more details. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct ImagenImageFormat { let mimeType: String let compressionQuality: Int? diff --git a/FirebaseAI/Sources/Types/Public/Imagen/ImagenInlineImage.swift b/FirebaseAI/Sources/Types/Public/Imagen/ImagenInlineImage.swift index 4f9a1d9d74f..75ed2419fa0 100644 --- a/FirebaseAI/Sources/Types/Public/Imagen/ImagenInlineImage.swift +++ b/FirebaseAI/Sources/Types/Public/Imagen/ImagenInlineImage.swift @@ -15,7 +15,6 @@ import Foundation /// An image generated by Imagen, represented as inline data. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct ImagenInlineImage: Sendable { /// The IANA standard MIME type of the image file; either `"image/png"` or `"image/jpeg"`. /// @@ -32,7 +31,6 @@ public struct ImagenInlineImage: Sendable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension ImagenInlineImage: ImagenImageRepresentable { // TODO(andrewheard): Make this public when the SDK supports Imagen operations that take images as // input (upscaling / editing). @@ -45,12 +43,10 @@ extension ImagenInlineImage: ImagenImageRepresentable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension ImagenInlineImage: Equatable {} // MARK: - Codable Conformances -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension ImagenInlineImage: Decodable { enum CodingKeys: CodingKey { case mimeType diff --git a/FirebaseAI/Sources/Types/Public/Imagen/ImagenModel.swift b/FirebaseAI/Sources/Types/Public/Imagen/ImagenModel.swift index 51a59796de6..1999c409ad4 100644 --- a/FirebaseAI/Sources/Types/Public/Imagen/ImagenModel.swift +++ b/FirebaseAI/Sources/Types/Public/Imagen/ImagenModel.swift @@ -22,7 +22,6 @@ import Foundation /// documentation](https://firebase.google.com/docs/vertex-ai/generate-images-imagen?platform=ios) /// for more details about the image generation capabilities offered by the Imagen model in the /// Firebase AI SDK SDK. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public final class ImagenModel { /// Model name prefix to identify Imagen models. static let imagenModelNamePrefix = "imagen-" diff --git a/FirebaseAI/Sources/Types/Public/Imagen/ImagenPersonFilterLevel.swift b/FirebaseAI/Sources/Types/Public/Imagen/ImagenPersonFilterLevel.swift index 8664c502617..c458191ece9 100644 --- a/FirebaseAI/Sources/Types/Public/Imagen/ImagenPersonFilterLevel.swift +++ b/FirebaseAI/Sources/Types/Public/Imagen/ImagenPersonFilterLevel.swift @@ -17,7 +17,6 @@ /// See the /// [`personGeneration`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/imagen-api#parameter_list) /// documentation for more details. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct ImagenPersonFilterLevel: ProtoEnum { enum Kind: String { case blockAll = "dont_allow" diff --git a/FirebaseAI/Sources/Types/Public/Imagen/ImagenSafetyFilterLevel.swift b/FirebaseAI/Sources/Types/Public/Imagen/ImagenSafetyFilterLevel.swift index 43fe1ad59ad..162dafed2c6 100644 --- a/FirebaseAI/Sources/Types/Public/Imagen/ImagenSafetyFilterLevel.swift +++ b/FirebaseAI/Sources/Types/Public/Imagen/ImagenSafetyFilterLevel.swift @@ -22,7 +22,6 @@ /// documentation and the [Responsible AI and usage /// guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) /// for more details. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct ImagenSafetyFilterLevel: ProtoEnum, Sendable { enum Kind: String { case blockLowAndAbove = "block_low_and_above" diff --git a/FirebaseAI/Sources/Types/Public/Imagen/ImagenSafetySettings.swift b/FirebaseAI/Sources/Types/Public/Imagen/ImagenSafetySettings.swift index 9c10faf4282..e3fcf881d8a 100644 --- a/FirebaseAI/Sources/Types/Public/Imagen/ImagenSafetySettings.swift +++ b/FirebaseAI/Sources/Types/Public/Imagen/ImagenSafetySettings.swift @@ -19,7 +19,6 @@ import Foundation /// See the [Responsible AI and usage /// guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#config-safety-filters) /// for more details. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct ImagenSafetySettings { let safetyFilterLevel: ImagenSafetyFilterLevel? let personFilterLevel: ImagenPersonFilterLevel? diff --git a/FirebaseAI/Sources/Types/Public/Live/AudioTranscriptionConfig.swift b/FirebaseAI/Sources/Types/Public/Live/AudioTranscriptionConfig.swift index 365afebc5da..ed3d23bc0d5 100644 --- a/FirebaseAI/Sources/Types/Public/Live/AudioTranscriptionConfig.swift +++ b/FirebaseAI/Sources/Types/Public/Live/AudioTranscriptionConfig.swift @@ -18,7 +18,6 @@ /// While there are not currently any options, this will likely change in the future. For now, just /// providing an instance of this struct will enable audio transcriptions for the corresponding /// input or output fields. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) public struct AudioTranscriptionConfig: Sendable { let audioTranscriptionConfig: BidiAudioTranscriptionConfig diff --git a/FirebaseAI/Sources/Types/Public/Live/LiveAudioTranscription.swift b/FirebaseAI/Sources/Types/Public/Live/LiveAudioTranscription.swift index 76dc112ee03..b56e40c7ce3 100644 --- a/FirebaseAI/Sources/Types/Public/Live/LiveAudioTranscription.swift +++ b/FirebaseAI/Sources/Types/Public/Live/LiveAudioTranscription.swift @@ -13,7 +13,6 @@ // limitations under the License. /// Text transcription of some audio form during a live interaction with the model. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) public struct LiveAudioTranscription: Sendable { let transcript: BidiGenerateContentTranscription diff --git a/FirebaseAI/Sources/Types/Public/Live/LiveGenerationConfig.swift b/FirebaseAI/Sources/Types/Public/Live/LiveGenerationConfig.swift index c7033567a91..1302d1be31f 100644 --- a/FirebaseAI/Sources/Types/Public/Live/LiveGenerationConfig.swift +++ b/FirebaseAI/Sources/Types/Public/Live/LiveGenerationConfig.swift @@ -15,7 +15,6 @@ import Foundation /// Configuration options for live content generation. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) public struct LiveGenerationConfig: Sendable { let bidiGenerationConfig: BidiGenerationConfig diff --git a/FirebaseAI/Sources/Types/Public/Live/LiveGenerativeModel.swift b/FirebaseAI/Sources/Types/Public/Live/LiveGenerativeModel.swift index 3a8236cb1d5..7ba1bb0ac72 100644 --- a/FirebaseAI/Sources/Types/Public/Live/LiveGenerativeModel.swift +++ b/FirebaseAI/Sources/Types/Public/Live/LiveGenerativeModel.swift @@ -18,7 +18,6 @@ import Foundation /// various input types, supporting bidirectional streaming. /// /// You can create a new session via ``LiveGenerativeModel/connect()``. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) public final class LiveGenerativeModel { let modelResourceName: String diff --git a/FirebaseAI/Sources/Types/Public/Live/LiveServerContent.swift b/FirebaseAI/Sources/Types/Public/Live/LiveServerContent.swift index 15a8b310cf6..c770dc0579d 100644 --- a/FirebaseAI/Sources/Types/Public/Live/LiveServerContent.swift +++ b/FirebaseAI/Sources/Types/Public/Live/LiveServerContent.swift @@ -17,7 +17,6 @@ /// /// Content is generated as quickly as possible, and not in realtime. Clients /// may choose to buffer and play it out in realtime. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) public struct LiveServerContent: Sendable { let serverContent: BidiGenerateContentServerContent diff --git a/FirebaseAI/Sources/Types/Public/Live/LiveServerGoingAwayNotice.swift b/FirebaseAI/Sources/Types/Public/Live/LiveServerGoingAwayNotice.swift index 981ddf0c251..bafe3dc2882 100644 --- a/FirebaseAI/Sources/Types/Public/Live/LiveServerGoingAwayNotice.swift +++ b/FirebaseAI/Sources/Types/Public/Live/LiveServerGoingAwayNotice.swift @@ -17,7 +17,6 @@ import Foundation /// Server will not be able to service client soon. /// /// To learn more about session limits, see the docs on [Maximum session duration](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/multimodal-live#maximum-session-duration)\. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) public struct LiveServerGoingAwayNotice: Sendable { let goAway: GoAway diff --git a/FirebaseAI/Sources/Types/Public/Live/LiveServerMessage.swift b/FirebaseAI/Sources/Types/Public/Live/LiveServerMessage.swift index af6caca90c1..e164a3e07b1 100644 --- a/FirebaseAI/Sources/Types/Public/Live/LiveServerMessage.swift +++ b/FirebaseAI/Sources/Types/Public/Live/LiveServerMessage.swift @@ -13,7 +13,6 @@ // limitations under the License. /// Update from the server, generated from the model in response to client messages. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) public struct LiveServerMessage: Sendable { let serverMessage: BidiGenerateContentServerMessage @@ -47,7 +46,6 @@ public struct LiveServerMessage: Sendable { // MARK: - Internal parsing -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) extension LiveServerMessage { init?(from serverMessage: BidiGenerateContentServerMessage) { @@ -60,7 +58,6 @@ extension LiveServerMessage { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) extension LiveServerMessage.Payload { init?(from serverMessage: BidiGenerateContentServerMessage.MessageType) { diff --git a/FirebaseAI/Sources/Types/Public/Live/LiveServerToolCall.swift b/FirebaseAI/Sources/Types/Public/Live/LiveServerToolCall.swift index 6c55ee5ff4c..b61f0c2dd65 100644 --- a/FirebaseAI/Sources/Types/Public/Live/LiveServerToolCall.swift +++ b/FirebaseAI/Sources/Types/Public/Live/LiveServerToolCall.swift @@ -16,7 +16,6 @@ /// /// The client should return matching ``FunctionResponsePart``, where the /// ``FunctionResponsePart/functionId`` fields correspond to individual ``FunctionCallPart``s. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) @available(watchOS, unavailable) public struct LiveServerToolCall: Sendable { let serverToolCall: BidiGenerateContentToolCall diff --git a/FirebaseAI/Sources/Types/Public/Live/LiveServerToolCallCancellation.swift b/FirebaseAI/Sources/Types/Public/Live/LiveServerToolCallCancellation.swift index 1572c30c5bc..34265a227a7 100644 --- a/FirebaseAI/Sources/Types/Public/Live/LiveServerToolCallCancellation.swift +++ b/FirebaseAI/Sources/Types/Public/Live/LiveServerToolCallCancellation.swift @@ -16,7 +16,6 @@ /// /// The client does not need to send ``FunctionResponsePart``s for the cancelled /// ``FunctionCallPart``s. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) public struct LiveServerToolCallCancellation: Sendable { let serverToolCallCancellation: BidiGenerateContentToolCallCancellation diff --git a/FirebaseAI/Sources/Types/Public/Live/LiveSession.swift b/FirebaseAI/Sources/Types/Public/Live/LiveSession.swift index a7ece57bdfc..c338a2c3167 100644 --- a/FirebaseAI/Sources/Types/Public/Live/LiveSession.swift +++ b/FirebaseAI/Sources/Types/Public/Live/LiveSession.swift @@ -22,7 +22,6 @@ import Foundation /// ``LiveSession/sendContent(_:turnComplete:)-(PartsRepresentable...,_)``). /// /// To create an instance of this class, see ``LiveGenerativeModel``. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) @available(watchOS, unavailable) public final class LiveSession: Sendable { private let service: LiveSessionService diff --git a/FirebaseAI/Sources/Types/Public/Live/LiveSessionErrors.swift b/FirebaseAI/Sources/Types/Public/Live/LiveSessionErrors.swift index 59a1e920e84..454f8816303 100644 --- a/FirebaseAI/Sources/Types/Public/Live/LiveSessionErrors.swift +++ b/FirebaseAI/Sources/Types/Public/Live/LiveSessionErrors.swift @@ -22,7 +22,6 @@ import Foundation /// /// Check the `NSUnderlyingErrorKey` entry in ``LiveSessionUnsupportedMessageError/errorUserInfo`` /// for the error that caused this. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) public struct LiveSessionUnsupportedMessageError: Error, Sendable, CustomNSError { let underlyingError: Error @@ -43,7 +42,6 @@ public struct LiveSessionUnsupportedMessageError: Error, Sendable, CustomNSError /// /// Check the `NSUnderlyingErrorKey` entry in ``LiveSessionLostConnectionError/errorUserInfo`` for /// the error that caused this. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) public struct LiveSessionLostConnectionError: Error, Sendable, CustomNSError { let underlyingError: Error @@ -64,7 +62,6 @@ public struct LiveSessionLostConnectionError: Error, Sendable, CustomNSError { /// /// Check the `NSUnderlyingErrorKey` entry in ``LiveSessionUnexpectedClosureError/errorUserInfo`` /// for the error that caused this. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) public struct LiveSessionUnexpectedClosureError: Error, Sendable, CustomNSError { let underlyingError: WebSocketClosedError @@ -88,7 +85,6 @@ public struct LiveSessionUnexpectedClosureError: Error, Sendable, CustomNSError /// /// Check the `NSUnderlyingErrorKey` entry in ``LiveSessionSetupError/errorUserInfo`` for the error /// that caused this. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) public struct LiveSessionSetupError: Error, Sendable, CustomNSError { let underlyingError: Error diff --git a/FirebaseAI/Sources/Types/Public/Live/SpeechConfig.swift b/FirebaseAI/Sources/Types/Public/Live/SpeechConfig.swift index a8e291d62f3..f715b2ff396 100644 --- a/FirebaseAI/Sources/Types/Public/Live/SpeechConfig.swift +++ b/FirebaseAI/Sources/Types/Public/Live/SpeechConfig.swift @@ -15,7 +15,6 @@ import Foundation /// Configuration for controlling the voice of the model during conversation. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) @available(watchOS, unavailable) public struct SpeechConfig: Sendable { let speechConfig: BidiSpeechConfig diff --git a/FirebaseAI/Sources/Types/Public/Part.swift b/FirebaseAI/Sources/Types/Public/Part.swift index 379ba6e6a59..df492c7f75d 100644 --- a/FirebaseAI/Sources/Types/Public/Part.swift +++ b/FirebaseAI/Sources/Types/Public/Part.swift @@ -17,7 +17,6 @@ import Foundation /// 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. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public protocol Part: PartsRepresentable, Codable, Sendable, Equatable { /// Indicates whether this `Part` is a summary of the model's internal thinking process. /// @@ -28,7 +27,6 @@ public protocol Part: PartsRepresentable, Codable, Sendable, Equatable { } /// A text part containing a string value. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct TextPart: Part { /// Text value. public let text: String @@ -61,7 +59,6 @@ public struct TextPart: Part { /// see [input files and requirements /// ](https://firebase.google.com/docs/vertex-ai/input-file-requirements#provide-file-as-inline-data) /// for more details and size limits. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct InlineDataPart: Part { let inlineData: InlineData let _isThought: Bool? @@ -102,7 +99,6 @@ public struct InlineDataPart: Part { } /// File data stored in Cloud Storage for Firebase, referenced by URI. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct FileDataPart: Part { let fileData: FileData let _isThought: Bool? @@ -133,7 +129,6 @@ public struct FileDataPart: Part { } /// A predicted function call returned from the model. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct FunctionCallPart: Part { let functionCall: FunctionCall let _isThought: Bool? @@ -190,7 +185,6 @@ public struct FunctionCallPart: Part { /// Contains a string representing the `FunctionDeclaration.name` and a structured JSON object /// containing any output from the function is used as context to the model. This should contain the /// result of a ``FunctionCallPart`` made based on model prediction. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct FunctionResponsePart: Part { let functionResponse: FunctionResponse let _isThought: Bool? @@ -241,7 +235,6 @@ public struct FunctionResponsePart: Part { } /// A part containing code that was executed by the model. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct ExecutableCodePart: Part { /// The language of the code in an ``ExecutableCodePart``. public struct Language: Sendable, Equatable, CustomStringConvertible { @@ -296,7 +289,6 @@ public struct ExecutableCodePart: Part { } /// The result of executing code. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct CodeExecutionResultPart: Part { /// The outcome of a code execution. public struct Outcome: Sendable, Equatable, CustomStringConvertible { diff --git a/FirebaseAI/Sources/Types/Public/ResponseModality.swift b/FirebaseAI/Sources/Types/Public/ResponseModality.swift index 1a826df3374..080dbf89ec9 100644 --- a/FirebaseAI/Sources/Types/Public/ResponseModality.swift +++ b/FirebaseAI/Sources/Types/Public/ResponseModality.swift @@ -23,7 +23,6 @@ import Foundation /// /// > Important: Support for each response modality, or combination of modalities, depends on the /// > model. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct ResponseModality: EncodableProtoEnum, Sendable, Equatable { enum Kind: String { case text = "TEXT" diff --git a/FirebaseAI/Sources/Types/Public/Schema.swift b/FirebaseAI/Sources/Types/Public/Schema.swift index ab2fc7f4dd6..b288906cf73 100644 --- a/FirebaseAI/Sources/Types/Public/Schema.swift +++ b/FirebaseAI/Sources/Types/Public/Schema.swift @@ -18,10 +18,8 @@ import Foundation /// /// These types can be objects, but also primitives and arrays. Represents a select subset of an /// [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public final class Schema: Sendable { /// Modifiers describing the expected format of a string `Schema`. - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct StringFormat: EncodableProtoEnum { // This enum is currently only used to conform `StringFormat` to `ProtoEnum`, which requires // `associatedtype Kind: RawRepresentable`. @@ -39,7 +37,6 @@ public final class Schema: Sendable { } /// Modifiers describing the expected format of an integer `Schema`. - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct IntegerFormat: EncodableProtoEnum, Sendable { enum Kind: String { case int32 @@ -462,7 +459,6 @@ public final class Schema: Sendable { // MARK: - Codable Conformance -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension Schema: Encodable { enum CodingKeys: String, CodingKey { case dataType = "type" diff --git a/FirebaseAI/Sources/Types/Public/StructuredOutput/GeneratedContent.swift b/FirebaseAI/Sources/Types/Public/StructuredOutput/GeneratedContent.swift index da942933470..72ca5379070 100644 --- a/FirebaseAI/Sources/Types/Public/StructuredOutput/GeneratedContent.swift +++ b/FirebaseAI/Sources/Types/Public/StructuredOutput/GeneratedContent.swift @@ -26,7 +26,6 @@ .GeneratedContentProtocol {} #endif // canImport(FoundationModels) - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public extension FirebaseAI { /// Structured content generated by a model. /// @@ -203,7 +202,6 @@ } } - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public extension FirebaseAI.GeneratedContent { /// The kinds of values that can be represented by generated content. /// diff --git a/FirebaseAI/Sources/Types/Public/StructuredOutput/GenerationID.swift b/FirebaseAI/Sources/Types/Public/StructuredOutput/GenerationID.swift index cfc8ee6f62c..adf8689378b 100644 --- a/FirebaseAI/Sources/Types/Public/StructuredOutput/GenerationID.swift +++ b/FirebaseAI/Sources/Types/Public/StructuredOutput/GenerationID.swift @@ -17,7 +17,6 @@ import Foundation import struct FoundationModels.GenerationID #endif // canImport(FoundationModels) -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public extension FirebaseAI { /// An identifier for a specific generation. /// @@ -71,7 +70,6 @@ public extension FirebaseAI { extension FoundationModels.GenerationID: FirebaseAI.GenerationID.GenerationIDProtocol {} #endif // canImport(FoundationModels) -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension FirebaseAI.GenerationID: Equatable { public static func == (lhs: FirebaseAI.GenerationID, rhs: FirebaseAI.GenerationID) -> Bool { guard lhs.responseID == rhs.responseID else { @@ -90,7 +88,6 @@ extension FirebaseAI.GenerationID: Equatable { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension FirebaseAI.GenerationID: Hashable { public func hash(into hasher: inout Hasher) { hasher.combine(responseID) diff --git a/FirebaseAI/Sources/Types/Public/StructuredOutput/GenerationSchema.swift b/FirebaseAI/Sources/Types/Public/StructuredOutput/GenerationSchema.swift index 64847c8beb4..2a98114c3e3 100644 --- a/FirebaseAI/Sources/Types/Public/StructuredOutput/GenerationSchema.swift +++ b/FirebaseAI/Sources/Types/Public/StructuredOutput/GenerationSchema.swift @@ -25,7 +25,6 @@ import Foundation .GenerationSchemaProtocol {} #endif // canImport(FoundationModels) -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public extension FirebaseAI { struct GenerationSchema: Sendable { protocol GenerationSchemaProtocol: Sendable, Codable, CustomDebugStringConvertible {} diff --git a/FirebaseAI/Sources/Types/Public/URLContextMetadata.swift b/FirebaseAI/Sources/Types/Public/URLContextMetadata.swift index 5ff671f68eb..10f560096ec 100644 --- a/FirebaseAI/Sources/Types/Public/URLContextMetadata.swift +++ b/FirebaseAI/Sources/Types/Public/URLContextMetadata.swift @@ -13,7 +13,6 @@ // limitations under the License. /// Metadata related to the ``Tool/urlContext()`` tool. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct URLContextMetadata: Sendable, Hashable { /// List of URL metadata used to provide context to the Gemini model. public let urlMetadata: [URLMetadata] @@ -21,7 +20,6 @@ public struct URLContextMetadata: Sendable, Hashable { // MARK: - Codable Conformances -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension URLContextMetadata: Decodable { enum CodingKeys: CodingKey { case urlMetadata diff --git a/FirebaseAI/Sources/Types/Public/URLMetadata.swift b/FirebaseAI/Sources/Types/Public/URLMetadata.swift index 50ee16a7e86..1873105404a 100644 --- a/FirebaseAI/Sources/Types/Public/URLMetadata.swift +++ b/FirebaseAI/Sources/Types/Public/URLMetadata.swift @@ -15,7 +15,6 @@ import Foundation /// Metadata for a single URL retrieved by the ``Tool/urlContext()`` tool. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) public struct URLMetadata: Sendable, Hashable { /// Status of the URL retrieval. public struct URLRetrievalStatus: DecodableProtoEnum, Hashable { @@ -58,7 +57,6 @@ public struct URLMetadata: Sendable, Hashable { // MARK: - Codable Conformances -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension URLMetadata: Decodable { enum CodingKeys: String, CodingKey { case retrievedURL = "retrievedUrl" diff --git a/FirebaseAI/Tests/Unit/APITests.swift b/FirebaseAI/Tests/Unit/APITests.swift index d6e870f42b7..8e47a6ffafa 100644 --- a/FirebaseAI/Tests/Unit/APITests.swift +++ b/FirebaseAI/Tests/Unit/APITests.swift @@ -21,7 +21,6 @@ import XCTest import UIKit // For UIImage extensions. #endif -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class APITests: XCTestCase { func codeSamples() async throws { let app = FirebaseApp.app() diff --git a/FirebaseAI/Tests/Unit/ChatTests.swift b/FirebaseAI/Tests/Unit/ChatTests.swift index b2e43ba610c..3648f7d6ec4 100644 --- a/FirebaseAI/Tests/Unit/ChatTests.swift +++ b/FirebaseAI/Tests/Unit/ChatTests.swift @@ -18,7 +18,7 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) +@available(macOS 12.0, watchOS 8.0, *) final class ChatTests: XCTestCase { let modelName = "test-model-name" let modelResourceName = "projects/my-project/locations/us-central1/models/test-model-name" diff --git a/FirebaseAI/Tests/Unit/Fakes/AppCheckInteropFake.swift b/FirebaseAI/Tests/Unit/Fakes/AppCheckInteropFake.swift index 81b6ac1bb7c..505064482c5 100644 --- a/FirebaseAI/Tests/Unit/Fakes/AppCheckInteropFake.swift +++ b/FirebaseAI/Tests/Unit/Fakes/AppCheckInteropFake.swift @@ -15,7 +15,6 @@ import FirebaseAppCheckInterop import Foundation -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) class AppCheckInteropFake: NSObject, AppCheckInterop { /// The placeholder token value returned when an error occurs static let placeholderTokenValue = "placeholder-token" diff --git a/FirebaseAI/Tests/Unit/Fakes/AuthInteropFake.swift b/FirebaseAI/Tests/Unit/Fakes/AuthInteropFake.swift index a2f6f0eb755..ba216980c22 100644 --- a/FirebaseAI/Tests/Unit/Fakes/AuthInteropFake.swift +++ b/FirebaseAI/Tests/Unit/Fakes/AuthInteropFake.swift @@ -15,7 +15,6 @@ import FirebaseAuthInterop import Foundation -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) class AuthInteropFake: NSObject, AuthInterop { let token: String? let error: Error? diff --git a/FirebaseAI/Tests/Unit/GenerationConfigTests.swift b/FirebaseAI/Tests/Unit/GenerationConfigTests.swift index 844603d7dab..da031580be1 100644 --- a/FirebaseAI/Tests/Unit/GenerationConfigTests.swift +++ b/FirebaseAI/Tests/Unit/GenerationConfigTests.swift @@ -16,7 +16,6 @@ import Foundation import XCTest -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class GenerationConfigTests: XCTestCase { let encoder = JSONEncoder() diff --git a/FirebaseAI/Tests/Unit/GenerativeAIServiceTests.swift b/FirebaseAI/Tests/Unit/GenerativeAIServiceTests.swift index b0f7c18eb1e..910f9f6dffd 100644 --- a/FirebaseAI/Tests/Unit/GenerativeAIServiceTests.swift +++ b/FirebaseAI/Tests/Unit/GenerativeAIServiceTests.swift @@ -20,7 +20,7 @@ import XCTest @testable import FirebaseAILogic #if !os(watchOS) - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) + @available(macOS 12.0, *) final class GenerativeAIServiceTests: XCTestCase { let testModelName = "test-model" let testModelResourceName = diff --git a/FirebaseAI/Tests/Unit/GenerativeModelGoogleAITests.swift b/FirebaseAI/Tests/Unit/GenerativeModelGoogleAITests.swift index f04e1d387df..eaf7b1a1c04 100644 --- a/FirebaseAI/Tests/Unit/GenerativeModelGoogleAITests.swift +++ b/FirebaseAI/Tests/Unit/GenerativeModelGoogleAITests.swift @@ -19,7 +19,7 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) +@available(macOS 12.0, watchOS 8.0, *) final class GenerativeModelGoogleAITests: XCTestCase { let testPrompt = "What sorts of questions can I ask you?" let safetyRatingsNegligible: [SafetyRating] = [ diff --git a/FirebaseAI/Tests/Unit/GenerativeModelVertexAICachingTests.swift b/FirebaseAI/Tests/Unit/GenerativeModelVertexAICachingTests.swift index 50074f6d49a..eb601d29a34 100644 --- a/FirebaseAI/Tests/Unit/GenerativeModelVertexAICachingTests.swift +++ b/FirebaseAI/Tests/Unit/GenerativeModelVertexAICachingTests.swift @@ -19,7 +19,7 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) +@available(macOS 12.0, watchOS 8.0, *) final class GenerativeModelImplicitCachingTests: XCTestCase { let testPrompt = "What sorts of questions can I ask you?" let testModelName = "test-model" diff --git a/FirebaseAI/Tests/Unit/GenerativeModelVertexAITests.swift b/FirebaseAI/Tests/Unit/GenerativeModelVertexAITests.swift index b302af838c4..368828272cb 100644 --- a/FirebaseAI/Tests/Unit/GenerativeModelVertexAITests.swift +++ b/FirebaseAI/Tests/Unit/GenerativeModelVertexAITests.swift @@ -19,7 +19,7 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) +@available(macOS 12.0, watchOS 8.0, *) final class GenerativeModelVertexAITests: XCTestCase { let testPrompt = "What sorts of questions can I ask you?" let safetyRatingsNegligible: [SafetyRating] = [ @@ -1938,7 +1938,6 @@ final class GenerativeModelVertexAITests: XCTestCase { } } -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension SafetyRating: Swift.Comparable { public static func < (lhs: SafetyRating, rhs: SafetyRating) -> Bool { return lhs.category.rawValue < rhs.category.rawValue diff --git a/FirebaseAI/Tests/Unit/JSONValueTests.swift b/FirebaseAI/Tests/Unit/JSONValueTests.swift index 1f1beafe922..1a5276c3cde 100644 --- a/FirebaseAI/Tests/Unit/JSONValueTests.swift +++ b/FirebaseAI/Tests/Unit/JSONValueTests.swift @@ -15,7 +15,6 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class JSONValueTests: XCTestCase { let decoder = JSONDecoder() let encoder = JSONEncoder() diff --git a/FirebaseAI/Tests/Unit/MockURLProtocol.swift b/FirebaseAI/Tests/Unit/MockURLProtocol.swift index 6db227d5cfb..3c1852ecfd7 100644 --- a/FirebaseAI/Tests/Unit/MockURLProtocol.swift +++ b/FirebaseAI/Tests/Unit/MockURLProtocol.swift @@ -15,7 +15,7 @@ import Foundation import XCTest -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) +@available(macOS 12.0, watchOS 8.0, *) class MockURLProtocol: URLProtocol, @unchecked Sendable { nonisolated(unsafe) static var requestHandler: ((URLRequest) throws -> ( URLResponse, diff --git a/FirebaseAI/Tests/Unit/PartTests.swift b/FirebaseAI/Tests/Unit/PartTests.swift index 6c5429928d0..f6a4c92d524 100644 --- a/FirebaseAI/Tests/Unit/PartTests.swift +++ b/FirebaseAI/Tests/Unit/PartTests.swift @@ -17,7 +17,6 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class PartTests: XCTestCase { let decoder = JSONDecoder() let encoder = JSONEncoder() diff --git a/FirebaseAI/Tests/Unit/PartsRepresentableTests.swift b/FirebaseAI/Tests/Unit/PartsRepresentableTests.swift index 266a64b3429..8ca9af5044c 100644 --- a/FirebaseAI/Tests/Unit/PartsRepresentableTests.swift +++ b/FirebaseAI/Tests/Unit/PartsRepresentableTests.swift @@ -25,7 +25,6 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class PartsRepresentableTests: XCTestCase { #if !os(watchOS) func testModelContentFromCGImageIsNotEmpty() throws { diff --git a/FirebaseAI/Tests/Unit/RequestOptionsTest.swift b/FirebaseAI/Tests/Unit/RequestOptionsTest.swift index 92ab65f1f95..26b0cb3c77b 100644 --- a/FirebaseAI/Tests/Unit/RequestOptionsTest.swift +++ b/FirebaseAI/Tests/Unit/RequestOptionsTest.swift @@ -16,7 +16,6 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class RequestOptionsTests: XCTestCase { let defaultTimeout: TimeInterval = 180.0 diff --git a/FirebaseAI/Tests/Unit/SafetyTests.swift b/FirebaseAI/Tests/Unit/SafetyTests.swift index b4422b61fb5..3cd98b32bf4 100644 --- a/FirebaseAI/Tests/Unit/SafetyTests.swift +++ b/FirebaseAI/Tests/Unit/SafetyTests.swift @@ -16,7 +16,6 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class SafetyTests: XCTestCase { let decoder = JSONDecoder() let encoder = JSONEncoder() diff --git a/FirebaseAI/Tests/Unit/Snippets/ChatSnippets.swift b/FirebaseAI/Tests/Unit/Snippets/ChatSnippets.swift index 67bd5cb9a4a..95d75dde6ec 100644 --- a/FirebaseAI/Tests/Unit/Snippets/ChatSnippets.swift +++ b/FirebaseAI/Tests/Unit/Snippets/ChatSnippets.swift @@ -19,7 +19,7 @@ import XCTest // These snippet tests are intentionally skipped in CI jobs; see the README file in this directory // for instructions on running them manually. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) +@available(macOS 12.0, watchOS 8.0, *) final class ChatSnippets: XCTestCase { lazy var model = FirebaseAI.firebaseAI().generativeModel(modelName: "gemini-2.0-flash") diff --git a/FirebaseAI/Tests/Unit/Snippets/CloudStorageSnippets.swift b/FirebaseAI/Tests/Unit/Snippets/CloudStorageSnippets.swift index 3d04e156312..b7172133e7f 100644 --- a/FirebaseAI/Tests/Unit/Snippets/CloudStorageSnippets.swift +++ b/FirebaseAI/Tests/Unit/Snippets/CloudStorageSnippets.swift @@ -20,7 +20,6 @@ // These CloudStorageSnippets are not currently runnable due to the GCS upload paths but are used // as compilation tests. - @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class CloudStorageSnippets { let model: GenerativeModel! = nil diff --git a/FirebaseAI/Tests/Unit/Snippets/CountTokensSnippets.swift b/FirebaseAI/Tests/Unit/Snippets/CountTokensSnippets.swift index 37c4f7e3c04..80facfaccf7 100644 --- a/FirebaseAI/Tests/Unit/Snippets/CountTokensSnippets.swift +++ b/FirebaseAI/Tests/Unit/Snippets/CountTokensSnippets.swift @@ -19,7 +19,6 @@ import XCTest // These snippet tests are intentionally skipped in CI jobs; see the README file in this directory // for instructions on running them manually. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class CountTokensSnippets: XCTestCase { let bundle = BundleTestUtil.bundle() lazy var model = FirebaseAI.firebaseAI().generativeModel(modelName: "gemini-2.0-flash") diff --git a/FirebaseAI/Tests/Unit/Snippets/FunctionCallingSnippets.swift b/FirebaseAI/Tests/Unit/Snippets/FunctionCallingSnippets.swift index dac1dea76ba..d25adf2a56f 100644 --- a/FirebaseAI/Tests/Unit/Snippets/FunctionCallingSnippets.swift +++ b/FirebaseAI/Tests/Unit/Snippets/FunctionCallingSnippets.swift @@ -19,7 +19,6 @@ import XCTest // These snippet tests are intentionally skipped in CI jobs; see the README file in this directory // for instructions on running them manually. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class FunctionCallingSnippets: XCTestCase { override func setUpWithError() throws { try FirebaseApp.configureDefaultAppForSnippets() diff --git a/FirebaseAI/Tests/Unit/Snippets/LiveSnippets.swift b/FirebaseAI/Tests/Unit/Snippets/LiveSnippets.swift index 6b183d958b4..1ce78df8da6 100644 --- a/FirebaseAI/Tests/Unit/Snippets/LiveSnippets.swift +++ b/FirebaseAI/Tests/Unit/Snippets/LiveSnippets.swift @@ -19,7 +19,6 @@ import XCTest // These snippet tests are intentionally skipped in CI jobs; see the README file in this directory // for instructions on running them manually. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) @available(watchOS, unavailable) final class LiveSnippets: XCTestCase { override func setUpWithError() throws { diff --git a/FirebaseAI/Tests/Unit/Snippets/MultimodalSnippets.swift b/FirebaseAI/Tests/Unit/Snippets/MultimodalSnippets.swift index 7e8af1e3882..29e1e5846b6 100644 --- a/FirebaseAI/Tests/Unit/Snippets/MultimodalSnippets.swift +++ b/FirebaseAI/Tests/Unit/Snippets/MultimodalSnippets.swift @@ -23,7 +23,7 @@ import XCTest // These snippet tests are intentionally skipped in CI jobs; see the README file in this directory // for instructions on running them manually. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) +@available(macOS 12.0, watchOS 8.0, *) final class MultimodalSnippets: XCTestCase { let bundle = BundleTestUtil.bundle() lazy var model = FirebaseAI.firebaseAI(backend: .vertexAI()).generativeModel( diff --git a/FirebaseAI/Tests/Unit/Snippets/StructuredOutputSnippets.swift b/FirebaseAI/Tests/Unit/Snippets/StructuredOutputSnippets.swift index 17c426c3651..4d886491862 100644 --- a/FirebaseAI/Tests/Unit/Snippets/StructuredOutputSnippets.swift +++ b/FirebaseAI/Tests/Unit/Snippets/StructuredOutputSnippets.swift @@ -19,7 +19,6 @@ import XCTest // These snippet tests are intentionally skipped in CI jobs; see the README file in this directory // for instructions on running them manually. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class StructuredOutputSnippets: XCTestCase { override func setUpWithError() throws { try FirebaseApp.configureDefaultAppForSnippets() diff --git a/FirebaseAI/Tests/Unit/Snippets/TextSnippets.swift b/FirebaseAI/Tests/Unit/Snippets/TextSnippets.swift index 47ee865585d..4110ef90dd3 100644 --- a/FirebaseAI/Tests/Unit/Snippets/TextSnippets.swift +++ b/FirebaseAI/Tests/Unit/Snippets/TextSnippets.swift @@ -19,7 +19,7 @@ import XCTest // These snippet tests are intentionally skipped in CI jobs; see the README file in this directory // for instructions on running them manually. -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) +@available(macOS 12.0, watchOS 8.0, *) final class TextSnippets: XCTestCase { lazy var model = FirebaseAI.firebaseAI().generativeModel(modelName: "gemini-2.0-flash") diff --git a/FirebaseAI/Tests/Unit/TemplateChatSessionTests.swift b/FirebaseAI/Tests/Unit/TemplateChatSessionTests.swift index 3ff5ad14ff0..dad73992eaa 100644 --- a/FirebaseAI/Tests/Unit/TemplateChatSessionTests.swift +++ b/FirebaseAI/Tests/Unit/TemplateChatSessionTests.swift @@ -16,7 +16,7 @@ import FirebaseCore import XCTest -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) +@available(macOS 12.0, watchOS 8.0, *) final class TemplateChatSessionTests: XCTestCase { var model: TemplateGenerativeModel! var urlSession: URLSession! diff --git a/FirebaseAI/Tests/Unit/TemplateGenerativeModelTests.swift b/FirebaseAI/Tests/Unit/TemplateGenerativeModelTests.swift index a9994b8cf7a..6a1989dcbf9 100644 --- a/FirebaseAI/Tests/Unit/TemplateGenerativeModelTests.swift +++ b/FirebaseAI/Tests/Unit/TemplateGenerativeModelTests.swift @@ -16,7 +16,7 @@ import FirebaseCore import XCTest -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) +@available(macOS 12.0, watchOS 8.0, *) final class TemplateGenerativeModelTests: XCTestCase { var urlSession: URLSession! var model: TemplateGenerativeModel! diff --git a/FirebaseAI/Tests/Unit/TemplateImagenModelTests.swift b/FirebaseAI/Tests/Unit/TemplateImagenModelTests.swift index 04712b377b8..dff1e092b32 100644 --- a/FirebaseAI/Tests/Unit/TemplateImagenModelTests.swift +++ b/FirebaseAI/Tests/Unit/TemplateImagenModelTests.swift @@ -15,7 +15,7 @@ @testable import FirebaseAILogic import XCTest -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) +@available(macOS 12.0, watchOS 8.0, *) final class TemplateImagenModelTests: XCTestCase { var urlSession: URLSession! var model: TemplateImagenModel! diff --git a/FirebaseAI/Tests/Unit/TemplateInputTests.swift b/FirebaseAI/Tests/Unit/TemplateInputTests.swift index 2ed428be12b..018660c3d4d 100644 --- a/FirebaseAI/Tests/Unit/TemplateInputTests.swift +++ b/FirebaseAI/Tests/Unit/TemplateInputTests.swift @@ -15,7 +15,6 @@ @testable import FirebaseAILogic import XCTest -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class TemplateInputTests: XCTestCase { func testInitWithFloat() throws { let floatValue: Float = 3.14 diff --git a/FirebaseAI/Tests/Unit/TestUtilities/FirebaseAI+DefaultAPIConfig.swift b/FirebaseAI/Tests/Unit/TestUtilities/FirebaseAI+DefaultAPIConfig.swift index 3223a2abe2e..cdc1f4ee3c3 100644 --- a/FirebaseAI/Tests/Unit/TestUtilities/FirebaseAI+DefaultAPIConfig.swift +++ b/FirebaseAI/Tests/Unit/TestUtilities/FirebaseAI+DefaultAPIConfig.swift @@ -14,7 +14,6 @@ @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) extension FirebaseAI { static let defaultVertexAIAPIConfig = APIConfig( service: .vertexAI(endpoint: .firebaseProxyProd, location: "us-central1"), diff --git a/FirebaseAI/Tests/Unit/TestUtilities/GenerativeModelTestUtil.swift b/FirebaseAI/Tests/Unit/TestUtilities/GenerativeModelTestUtil.swift index ed07b25850d..1088db87ff4 100644 --- a/FirebaseAI/Tests/Unit/TestUtilities/GenerativeModelTestUtil.swift +++ b/FirebaseAI/Tests/Unit/TestUtilities/GenerativeModelTestUtil.swift @@ -20,7 +20,7 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) +@available(macOS 12.0, watchOS 8.0, *) enum GenerativeModelTestUtil { /// Returns an HTTP request handler static func httpRequestHandler(forResource name: String, diff --git a/FirebaseAI/Tests/Unit/Types/CitationMetadataTests.swift b/FirebaseAI/Tests/Unit/Types/CitationMetadataTests.swift index 4c908813d68..524bd42e43b 100644 --- a/FirebaseAI/Tests/Unit/Types/CitationMetadataTests.swift +++ b/FirebaseAI/Tests/Unit/Types/CitationMetadataTests.swift @@ -16,7 +16,6 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class CitationMetadataTests: XCTestCase { let decoder = JSONDecoder() diff --git a/FirebaseAI/Tests/Unit/Types/CitationTests.swift b/FirebaseAI/Tests/Unit/Types/CitationTests.swift index 1a372d8fd47..cbfc663d062 100644 --- a/FirebaseAI/Tests/Unit/Types/CitationTests.swift +++ b/FirebaseAI/Tests/Unit/Types/CitationTests.swift @@ -15,7 +15,6 @@ import FirebaseAILogic import XCTest -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class CitationTests: XCTestCase { let decoder = JSONDecoder() diff --git a/FirebaseAI/Tests/Unit/Types/GenerateContentResponseTests.swift b/FirebaseAI/Tests/Unit/Types/GenerateContentResponseTests.swift index 1d2a86d4526..d666fd4fdb7 100644 --- a/FirebaseAI/Tests/Unit/Types/GenerateContentResponseTests.swift +++ b/FirebaseAI/Tests/Unit/Types/GenerateContentResponseTests.swift @@ -15,7 +15,6 @@ @testable import FirebaseAILogic import XCTest -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class GenerateContentResponseTests: XCTestCase { let jsonDecoder = JSONDecoder() diff --git a/FirebaseAI/Tests/Unit/Types/GroundingMetadataTests.swift b/FirebaseAI/Tests/Unit/Types/GroundingMetadataTests.swift index ca5e8dc3ede..ba7ac29ea0c 100644 --- a/FirebaseAI/Tests/Unit/Types/GroundingMetadataTests.swift +++ b/FirebaseAI/Tests/Unit/Types/GroundingMetadataTests.swift @@ -16,7 +16,6 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class GroundingMetadataTests: XCTestCase { let decoder = JSONDecoder() diff --git a/FirebaseAI/Tests/Unit/Types/Imagen/ImageGenerationInstanceTests.swift b/FirebaseAI/Tests/Unit/Types/Imagen/ImageGenerationInstanceTests.swift index 4bebe401e55..57d61bac0a1 100644 --- a/FirebaseAI/Tests/Unit/Types/Imagen/ImageGenerationInstanceTests.swift +++ b/FirebaseAI/Tests/Unit/Types/Imagen/ImageGenerationInstanceTests.swift @@ -16,7 +16,6 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class ImageGenerationInstanceTests: XCTestCase { let encoder = JSONEncoder() diff --git a/FirebaseAI/Tests/Unit/Types/Imagen/ImageGenerationOutputOptionsTests.swift b/FirebaseAI/Tests/Unit/Types/Imagen/ImageGenerationOutputOptionsTests.swift index 9e135fa622c..568393e6808 100644 --- a/FirebaseAI/Tests/Unit/Types/Imagen/ImageGenerationOutputOptionsTests.swift +++ b/FirebaseAI/Tests/Unit/Types/Imagen/ImageGenerationOutputOptionsTests.swift @@ -16,7 +16,6 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class ImageGenerationOutputOptionsTests: XCTestCase { let encoder = JSONEncoder() diff --git a/FirebaseAI/Tests/Unit/Types/Imagen/ImageGenerationParametersTests.swift b/FirebaseAI/Tests/Unit/Types/Imagen/ImageGenerationParametersTests.swift index 0d398738111..e565fa71302 100644 --- a/FirebaseAI/Tests/Unit/Types/Imagen/ImageGenerationParametersTests.swift +++ b/FirebaseAI/Tests/Unit/Types/Imagen/ImageGenerationParametersTests.swift @@ -16,7 +16,6 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class ImageGenerationParametersTests: XCTestCase { let encoder = JSONEncoder() diff --git a/FirebaseAI/Tests/Unit/Types/Imagen/ImagenGCSImageTests.swift b/FirebaseAI/Tests/Unit/Types/Imagen/ImagenGCSImageTests.swift index 84da2d5a300..d55c31ed00a 100644 --- a/FirebaseAI/Tests/Unit/Types/Imagen/ImagenGCSImageTests.swift +++ b/FirebaseAI/Tests/Unit/Types/Imagen/ImagenGCSImageTests.swift @@ -16,7 +16,6 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class ImagenGCSImageTests: XCTestCase { let decoder = JSONDecoder() diff --git a/FirebaseAI/Tests/Unit/Types/Imagen/ImagenGenerationRequestTests.swift b/FirebaseAI/Tests/Unit/Types/Imagen/ImagenGenerationRequestTests.swift index 70a98a54321..60f9b7304d8 100644 --- a/FirebaseAI/Tests/Unit/Types/Imagen/ImagenGenerationRequestTests.swift +++ b/FirebaseAI/Tests/Unit/Types/Imagen/ImagenGenerationRequestTests.swift @@ -16,7 +16,6 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class ImagenGenerationRequestTests: XCTestCase { let encoder = JSONEncoder() let requestOptions = RequestOptions(timeout: 30.0) diff --git a/FirebaseAI/Tests/Unit/Types/Imagen/ImagenGenerationResponseTests.swift b/FirebaseAI/Tests/Unit/Types/Imagen/ImagenGenerationResponseTests.swift index 66e6cab4c8c..1d1c68a12bf 100644 --- a/FirebaseAI/Tests/Unit/Types/Imagen/ImagenGenerationResponseTests.swift +++ b/FirebaseAI/Tests/Unit/Types/Imagen/ImagenGenerationResponseTests.swift @@ -16,7 +16,6 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class ImagenGenerationResponseTests: XCTestCase { let decoder = JSONDecoder() diff --git a/FirebaseAI/Tests/Unit/Types/Imagen/ImagenInlineImageTests.swift b/FirebaseAI/Tests/Unit/Types/Imagen/ImagenInlineImageTests.swift index 0894b27fb44..ab01a1cb2fe 100644 --- a/FirebaseAI/Tests/Unit/Types/Imagen/ImagenInlineImageTests.swift +++ b/FirebaseAI/Tests/Unit/Types/Imagen/ImagenInlineImageTests.swift @@ -16,7 +16,6 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class ImagenInlineImageTests: XCTestCase { let decoder = JSONDecoder() diff --git a/FirebaseAI/Tests/Unit/Types/Imagen/RAIFilteredReasonTests.swift b/FirebaseAI/Tests/Unit/Types/Imagen/RAIFilteredReasonTests.swift index 4fdfa4416c7..4b974d7c158 100644 --- a/FirebaseAI/Tests/Unit/Types/Imagen/RAIFilteredReasonTests.swift +++ b/FirebaseAI/Tests/Unit/Types/Imagen/RAIFilteredReasonTests.swift @@ -16,7 +16,6 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class RAIFilteredReasonTests: XCTestCase { let decoder = JSONDecoder() diff --git a/FirebaseAI/Tests/Unit/Types/Internal/APIConfigTests.swift b/FirebaseAI/Tests/Unit/Types/Internal/APIConfigTests.swift index 79932f20e1b..dc54327018b 100644 --- a/FirebaseAI/Tests/Unit/Types/Internal/APIConfigTests.swift +++ b/FirebaseAI/Tests/Unit/Types/Internal/APIConfigTests.swift @@ -16,7 +16,6 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class APIConfigTests: XCTestCase { let defaultLocation = "us-central1" let globalLocation = "global" diff --git a/FirebaseAI/Tests/Unit/Types/Internal/Requests/CountTokensRequestTests.swift b/FirebaseAI/Tests/Unit/Types/Internal/Requests/CountTokensRequestTests.swift index 7c43833ed45..a410af016a6 100644 --- a/FirebaseAI/Tests/Unit/Types/Internal/Requests/CountTokensRequestTests.swift +++ b/FirebaseAI/Tests/Unit/Types/Internal/Requests/CountTokensRequestTests.swift @@ -17,7 +17,6 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class CountTokensRequestTests: XCTestCase { let encoder = JSONEncoder() diff --git a/FirebaseAI/Tests/Unit/Types/InternalPartTests.swift b/FirebaseAI/Tests/Unit/Types/InternalPartTests.swift index 3094135c5ab..90c824ee330 100644 --- a/FirebaseAI/Tests/Unit/Types/InternalPartTests.swift +++ b/FirebaseAI/Tests/Unit/Types/InternalPartTests.swift @@ -15,7 +15,6 @@ @testable import FirebaseAILogic import XCTest -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class InternalPartTests: XCTestCase { let decoder = JSONDecoder() diff --git a/FirebaseAI/Tests/Unit/Types/Live/BidiGenerateContentServerMessageTests.swift b/FirebaseAI/Tests/Unit/Types/Live/BidiGenerateContentServerMessageTests.swift index cf3403b37a1..b2bf53ce8a8 100644 --- a/FirebaseAI/Tests/Unit/Types/Live/BidiGenerateContentServerMessageTests.swift +++ b/FirebaseAI/Tests/Unit/Types/Live/BidiGenerateContentServerMessageTests.swift @@ -16,7 +16,6 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) @available(watchOS, unavailable) final class BidiGenerateContentServerMessageTests: XCTestCase { let decoder = JSONDecoder() diff --git a/FirebaseAI/Tests/Unit/Types/Live/VoiceConfigTests.swift b/FirebaseAI/Tests/Unit/Types/Live/VoiceConfigTests.swift index 3e57ce2d621..61b0473779e 100644 --- a/FirebaseAI/Tests/Unit/Types/Live/VoiceConfigTests.swift +++ b/FirebaseAI/Tests/Unit/Types/Live/VoiceConfigTests.swift @@ -16,7 +16,6 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) @available(watchOS, unavailable) final class VoiceConfigTests: XCTestCase { let encoder = JSONEncoder() diff --git a/FirebaseAI/Tests/Unit/Types/ModalityTokenCountTests.swift b/FirebaseAI/Tests/Unit/Types/ModalityTokenCountTests.swift index 12a58e992bb..948ea6fabef 100644 --- a/FirebaseAI/Tests/Unit/Types/ModalityTokenCountTests.swift +++ b/FirebaseAI/Tests/Unit/Types/ModalityTokenCountTests.swift @@ -15,7 +15,6 @@ import FirebaseAILogic import XCTest -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class ModalityTokenCountTests: XCTestCase { let decoder = JSONDecoder() diff --git a/FirebaseAI/Tests/Unit/Types/SchemaTests.swift b/FirebaseAI/Tests/Unit/Types/SchemaTests.swift index a24b4048645..4494ffed630 100644 --- a/FirebaseAI/Tests/Unit/Types/SchemaTests.swift +++ b/FirebaseAI/Tests/Unit/Types/SchemaTests.swift @@ -16,7 +16,6 @@ import FirebaseAILogic import Foundation import XCTest -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class SchemaTests: XCTestCase { let encoder = JSONEncoder() diff --git a/FirebaseAI/Tests/Unit/Types/ToolTests.swift b/FirebaseAI/Tests/Unit/Types/ToolTests.swift index 9b5c1851ea0..0d0dd485401 100644 --- a/FirebaseAI/Tests/Unit/Types/ToolTests.swift +++ b/FirebaseAI/Tests/Unit/Types/ToolTests.swift @@ -16,7 +16,6 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) final class ToolTests: XCTestCase { let encoder = JSONEncoder() diff --git a/FirebaseAI/Tests/Unit/VertexComponentTests.swift b/FirebaseAI/Tests/Unit/VertexComponentTests.swift index 9d33df1ff50..87774e4069e 100644 --- a/FirebaseAI/Tests/Unit/VertexComponentTests.swift +++ b/FirebaseAI/Tests/Unit/VertexComponentTests.swift @@ -19,7 +19,6 @@ import XCTest @testable import FirebaseAILogic -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) class VertexComponentTests: XCTestCase { static let projectID = "test-project-id" static let apiKey = "test-api-key" diff --git a/FirebaseAI/Wrapper/Tests/APITests.swift b/FirebaseAI/Wrapper/Tests/APITests.swift index 16c963b1f0c..1938a5c9ac9 100644 --- a/FirebaseAI/Wrapper/Tests/APITests.swift +++ b/FirebaseAI/Wrapper/Tests/APITests.swift @@ -21,7 +21,7 @@ import XCTest import UIKit // For UIImage extensions. #endif -@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) +@available(macOS 12.0, watchOS 8.0, *) final class APITests: XCTestCase { func codeSamples() async throws { let app = FirebaseApp.app() diff --git a/FirebaseAILogic.podspec b/FirebaseAILogic.podspec index 3580f8ce94e..845da2da03b 100644 --- a/FirebaseAILogic.podspec +++ b/FirebaseAILogic.podspec @@ -19,9 +19,9 @@ Build AI-powered apps and features with the Gemini API using the Firebase AI Log s.social_media_url = 'https://twitter.com/Firebase' ios_deployment_target = '15.0' - osx_deployment_target = '12.0' + osx_deployment_target = '10.15' tvos_deployment_target = '15.0' - watchos_deployment_target = '8.0' + watchos_deployment_target = '7.0' s.ios.deployment_target = ios_deployment_target s.osx.deployment_target = osx_deployment_target diff --git a/scripts/build.sh b/scripts/build.sh index 261c18c2157..b7dcbde0c33 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -768,13 +768,14 @@ case "$product-$platform-$method" in test ;; - # Note that the combine tests require setting the minimum iOS and tvOS version to 13.0 *-*-spm) RunXcodebuild \ -scheme $product \ "${xcb_flags[@]}" \ - IPHONEOS_DEPLOYMENT_TARGET=13.0 \ - TVOS_DEPLOYMENT_TARGET=13.0 \ + IPHONEOS_DEPLOYMENT_TARGET=15.0 \ + MACOSX_DEPLOYMENT_TARGET=10.15 \ + TVOS_DEPLOYMENT_TARGET=15.0 \ + WATCHOS_DEPLOYMENT_TARGET=7.0 \ test ;;