Skip to content

Commit

Permalink
Fix build in Xcode 14 / Swift 5.7.1 (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewheard authored Feb 6, 2024
1 parent 76797d5 commit 03b5dcf
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Sources/GoogleAI/GenerateContentRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ extension GenerateContentRequest: GenerativeAIRequest {

var url: URL {
if isStreaming {
URL(string: "\(GenerativeAISwift.baseURL)/\(model):streamGenerateContent?alt=sse")!
return URL(string: "\(GenerativeAISwift.baseURL)/\(model):streamGenerateContent?alt=sse")!
} else {
URL(string: "\(GenerativeAISwift.baseURL)/\(model):generateContent")!
return URL(string: "\(GenerativeAISwift.baseURL)/\(model):generateContent")!
}
}
}
2 changes: 1 addition & 1 deletion Tests/GoogleAITests/ChatTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Foundation
@testable import GoogleGenerativeAI
import XCTest

@available(iOS 15.0, tvOS 15.0, *)
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, *)
final class ChatTests: XCTestCase {
var urlSession: URLSession!

Expand Down
2 changes: 1 addition & 1 deletion Tests/GoogleAITests/GenerativeModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@testable import GoogleGenerativeAI
import XCTest

@available(iOS 15.0, tvOS 15.0, *)
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, *)
final class GenerativeModelTests: XCTestCase {
let testPrompt = "What sorts of questions can I ask you?"
let safetyRatingsNegligible: [SafetyRating] = [
Expand Down
2 changes: 1 addition & 1 deletion Tests/GoogleAITests/MockURLProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import Foundation
import XCTest

@available(iOS 15.0, tvOS 15.0, *)
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, *)
class MockURLProtocol: URLProtocol {
static var requestHandler: ((URLRequest) throws -> (
URLResponse,
Expand Down

0 comments on commit 03b5dcf

Please sign in to comment.