Skip to content

Commit

Permalink
Limit tests to iOS 15.0, macOS 11.0, macCatalyst 15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewheard committed Jul 30, 2024
1 parent eb04563 commit c511fa6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/GoogleAI/FunctionCalling.swift
Original file line number Diff line number Diff line change
Expand Up @@ -353,14 +353,13 @@ extension CodeExecution: Encodable {}

extension ExecutableCode: Codable {}

@available(iOS 15.0, macOS 11.0, macCatalyst 15.0, *)
extension CodeExecutionResult.Outcome: Codable {
public init(from decoder: any Decoder) throws {
let value = try decoder.singleValueContainer().decode(String.self)
guard let decodedOutcome = CodeExecutionResult.Outcome(rawValue: value) else {
if #available(iOS 15.0, macOS 11.0, macCatalyst 15.0, *) {
Logging.default
.error("[GoogleGenerativeAI] Unrecognized Outcome with value \"\(value)\".")
}
Logging.default
.error("[GoogleGenerativeAI] Unrecognized Outcome with value \"\(value)\".")
self = .unknown
return
}
Expand All @@ -369,6 +368,7 @@ extension CodeExecutionResult.Outcome: Codable {
}
}

@available(iOS 15.0, macOS 11.0, macCatalyst 15.0, *)
extension CodeExecutionResult: Codable {
public init(from decoder: any Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
Expand Down
1 change: 1 addition & 0 deletions Tests/GoogleAITests/CodeExecutionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import XCTest

@testable import GoogleGenerativeAI

@available(iOS 15.0, macOS 11.0, macCatalyst 15.0, *)
final class CodeExecutionTests: XCTestCase {
let decoder = JSONDecoder()
let encoder = JSONEncoder()
Expand Down

0 comments on commit c511fa6

Please sign in to comment.