Build Information
Failed to build OpenAIKit, reference 1.2.0 (e2e04f
), with Swift 6.1 for Wasm on 27 Jun 2025 20:14:38 UTC.
Build Command
bash -c docker run --pull=always --rm -v "checkouts-4606859-2":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:wasm-6.1-latest swift build --swift-sdk wasm32-unknown-wasi 2>&1
Build Log
========================================
RunAll
========================================
Builder version: 4.64.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/marcusziade/OpenAIKit.git
Reference: 1.2.0
Initialized empty Git repository in /host/spi-builder-workspace/.git/
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
From https://github.com/marcusziade/OpenAIKit
* tag 1.2.0 -> FETCH_HEAD
HEAD is now at e2e04f9 Fix release workflow for Swift Package releases
Cloned https://github.com/marcusziade/OpenAIKit.git
Revision (git rev-parse @):
e2e04f9a35d70100cc95221afbd0fa5ba09538be
SUCCESS checkout https://github.com/marcusziade/OpenAIKit.git at 1.2.0
========================================
Build
========================================
Selected platform: wasm
Swift version: 6.1
Building package at path: $PWD
https://github.com/marcusziade/OpenAIKit.git
https://github.com/marcusziade/OpenAIKit.git
WARNING: environment variable SUPPRESS_SWIFT_6_FLAGS is not set
{
"dependencies" : [
{
"identity" : "swift-docc-plugin",
"requirement" : {
"range" : [
{
"lower_bound" : "1.0.0",
"upper_bound" : "2.0.0"
}
]
},
"type" : "sourceControl",
"url" : "https://github.com/apple/swift-docc-plugin"
}
],
"manifest_display_name" : "OpenAIKit",
"name" : "OpenAIKit",
"path" : "/host/spi-builder-workspace",
"platforms" : [
{
"name" : "ios",
"version" : "15.0"
},
{
"name" : "macos",
"version" : "13.0"
},
{
"name" : "watchos",
"version" : "8.0"
},
{
"name" : "tvos",
"version" : "15.0"
},
{
"name" : "visionos",
"version" : "1.0"
}
],
"products" : [
{
"name" : "OpenAIKit",
"targets" : [
"OpenAIKit"
],
"type" : {
"library" : [
"automatic"
]
}
},
{
"name" : "OpenAIKitTester",
"targets" : [
"OpenAIKitTester"
],
"type" : {
"executable" : null
}
}
],
"targets" : [
{
"c99name" : "OpenAIKitTests",
"module_type" : "SwiftTarget",
"name" : "OpenAIKitTests",
"path" : "Tests/OpenAIKitTests",
"sources" : [
"AudioModelsTests.swift",
"ChatModelsTests.swift",
"ConfigurationTests.swift",
"EmbeddingModelsTests.swift",
"EnhancedErrorHandlingTests.swift",
"ErrorHandlingTests.swift",
"JSONValueTests.swift",
"ModelConstantsTests.swift",
"OpenAIKitTests.swift",
"RequestSerializationTests.swift",
"ResponseParsingTests.swift"
],
"target_dependencies" : [
"OpenAIKit"
],
"type" : "test"
},
{
"c99name" : "OpenAIKitTester",
"module_type" : "SwiftTarget",
"name" : "OpenAIKitTester",
"path" : "Sources/OpenAIKitTester",
"product_memberships" : [
"OpenAIKitTester"
],
"sources" : [
"Configuration/TestConfiguration.swift",
"OpenAIKitTester.swift",
"TestRunner.swift",
"Tests/AdvancedTests.swift",
"Tests/AudioTests.swift",
"Tests/BatchTests.swift",
"Tests/ChatTests.swift",
"Tests/DeepResearchTests.swift",
"Tests/EdgeCaseTests.swift",
"Tests/EmbeddingTests.swift",
"Tests/FileTests.swift",
"Tests/ImageTests.swift",
"Tests/ModelTests.swift",
"Tests/ModerationTests.swift",
"Utilities/TestProtocol.swift"
],
"target_dependencies" : [
"OpenAIKit"
],
"type" : "executable"
},
{
"c99name" : "OpenAIKit",
"module_type" : "SwiftTarget",
"name" : "OpenAIKit",
"path" : "Sources/OpenAIKit",
"product_memberships" : [
"OpenAIKit",
"OpenAIKitTester"
],
"sources" : [
"Core/NetworkClient.swift",
"Core/OpenAIError.swift",
"Core/Request.swift",
"Core/RetryHandler.swift",
"Endpoints/AssistantsEndpoint.swift",
"Endpoints/AudioEndpoint.swift",
"Endpoints/BatchEndpoint.swift",
"Endpoints/BatchesEndpoint.swift",
"Endpoints/ChatEndpoint.swift",
"Endpoints/EmbeddingsEndpoint.swift",
"Endpoints/FilesEndpoint.swift",
"Endpoints/FineTuningEndpoint.swift",
"Endpoints/ImagesEndpoint.swift",
"Endpoints/ModelsEndpoint.swift",
"Endpoints/ModerationsEndpoint.swift",
"Endpoints/ResponsesEndpoint.swift",
"Endpoints/ThreadsEndpoint.swift",
"Endpoints/VectorStoresEndpoint.swift",
"Extensions/OpenAIError+UI.swift",
"Models/Audio.swift",
"Models/Batch.swift",
"Models/Chat.swift",
"Models/Embeddings.swift",
"Models/Files.swift",
"Models/Images.swift",
"Models/ModelConstants.swift",
"Models/Models.swift",
"Models/Moderations.swift",
"Models/Responses.swift",
"OpenAIKit.swift",
"Utilities/JSONValue.swift"
],
"type" : "library"
}
],
"tools_version" : "5.9"
}
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-4606859-2":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:wasm-6.1-latest swift build --swift-sdk wasm32-unknown-wasi -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete -Xswiftc -enable-upcoming-feature -Xswiftc StrictConcurrency -Xswiftc -enable-upcoming-feature -Xswiftc DisableOutwardActorInference -Xswiftc -enable-upcoming-feature -Xswiftc GlobalActorIsolatedTypesUsability -Xswiftc -enable-upcoming-feature -Xswiftc InferSendableFromCaptures 2>&1
wasm-6.1-latest: Pulling from finestructure/spi-images
Digest: sha256:8f9255989265d824b88e7d572b1a334a0dc9b701075ede1970390db95d315c35
Status: Image is up to date for registry.gitlab.com/finestructure/spi-images:wasm-6.1-latest
Fetching https://github.com/apple/swift-docc-plugin
[1/2082] Fetching swift-docc-plugin
Fetched https://github.com/apple/swift-docc-plugin from cache (0.45s)
Computing version for https://github.com/apple/swift-docc-plugin
Computed https://github.com/apple/swift-docc-plugin at 1.4.4 (3.36s)
Fetching https://github.com/swiftlang/swift-docc-symbolkit
[1/3418] Fetching swift-docc-symbolkit
Fetched https://github.com/swiftlang/swift-docc-symbolkit from cache (0.42s)
Computing version for https://github.com/swiftlang/swift-docc-symbolkit
Computed https://github.com/swiftlang/swift-docc-symbolkit at 1.0.0 (1.21s)
Creating working copy for https://github.com/apple/swift-docc-plugin
Working copy of https://github.com/apple/swift-docc-plugin resolved at 1.4.4
Creating working copy for https://github.com/swiftlang/swift-docc-symbolkit
Working copy of https://github.com/swiftlang/swift-docc-symbolkit resolved at 1.0.0
[1/1] Compiling plugin Swift-DocC Preview
[2/2] Compiling plugin Swift-DocC
Building for debugging...
[2/9] Write sources
[4/9] Write swift-version-24593BA9C3E375BF.txt
error: emit-module command failed with exit code 1 (use -v to see invocation)
[6/38] Emitting module OpenAIKit
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:14:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
12 | public final class NetworkClient: NetworkClientProtocol, @unchecked Sendable {
13 |
14 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 | private let configuration: Configuration
16 | private let decoder: JSONDecoder
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:246:77: error: cannot find type 'URLRequest' in scope
244 | }
245 |
246 | private func buildURLRequest(from request: any Request) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
247 | let url = configuration.baseURL
248 | .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:266:86: error: cannot find type 'URLRequest' in scope
264 | }
265 |
266 | private func buildStreamingURLRequest(from request: any Request) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
267 | var urlRequest = try await buildURLRequest(from: request)
268 | urlRequest.setValue("text/event-stream", forHTTPHeaderField: "Accept")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:272:89: error: cannot find type 'URLRequest' in scope
270 | }
271 |
272 | private func buildUploadURLRequest(from request: any UploadRequest) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
273 | let url = configuration.baseURL
274 | .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:290:52: error: cannot find type 'URLRequest' in scope
288 | }
289 |
290 | private func configureHeaders(_ request: inout URLRequest) {
| `- error: cannot find type 'URLRequest' in scope
291 | request.setValue("Bearer \(configuration.apiKey)", forHTTPHeaderField: "Authorization")
292 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:304:47: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
302 | }
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
305 | guard let httpResponse = response as? HTTPURLResponse else {
306 | throw OpenAIError.invalidResponse
Foundation.URLResponse:2:18: note: 'URLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
[7/41] Compiling OpenAIKit ChatEndpoint.swift
[8/41] Compiling OpenAIKit EmbeddingsEndpoint.swift
[9/41] Compiling OpenAIKit FilesEndpoint.swift
[10/41] Compiling OpenAIKit FineTuningEndpoint.swift
[11/41] Compiling OpenAIKit NetworkClient.swift
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:14:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
12 | public final class NetworkClient: NetworkClientProtocol, @unchecked Sendable {
13 |
14 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 | private let configuration: Configuration
16 | private let decoder: JSONDecoder
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:246:77: error: cannot find type 'URLRequest' in scope
244 | }
245 |
246 | private func buildURLRequest(from request: any Request) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
247 | let url = configuration.baseURL
248 | .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:266:86: error: cannot find type 'URLRequest' in scope
264 | }
265 |
266 | private func buildStreamingURLRequest(from request: any Request) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
267 | var urlRequest = try await buildURLRequest(from: request)
268 | urlRequest.setValue("text/event-stream", forHTTPHeaderField: "Accept")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:272:89: error: cannot find type 'URLRequest' in scope
270 | }
271 |
272 | private func buildUploadURLRequest(from request: any UploadRequest) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
273 | let url = configuration.baseURL
274 | .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:290:52: error: cannot find type 'URLRequest' in scope
288 | }
289 |
290 | private func configureHeaders(_ request: inout URLRequest) {
| `- error: cannot find type 'URLRequest' in scope
291 | request.setValue("Bearer \(configuration.apiKey)", forHTTPHeaderField: "Authorization")
292 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:304:47: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
302 | }
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
305 | guard let httpResponse = response as? HTTPURLResponse else {
306 | throw OpenAIError.invalidResponse
Foundation.URLResponse:2:18: note: 'URLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:21:60: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
19 | self.configuration = configuration
20 |
21 | let sessionConfiguration = URLSessionConfiguration.default
| `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
22 | sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
23 | sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:24:24: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
22 | sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
23 | sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
24 | self.session = URLSession(configuration: sessionConfiguration)
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
25 |
26 | self.decoder = JSONDecoder()
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:71:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
69 | #else
70 | // macOS/iOS implementation
71 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
72 |
73 | try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:231:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
229 | #else
230 | // macOS/iOS implementation
231 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
232 |
233 | try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:251:26: error: cannot find 'URLRequest' in scope
249 | .appendingPathComponent(request.path)
250 |
251 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
252 | urlRequest.httpMethod = request.method.rawValue
253 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:277:26: error: cannot find 'URLRequest' in scope
275 | .appendingPathComponent(request.path)
276 |
277 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
278 | urlRequest.httpMethod = "POST"
279 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:43: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 | guard let httpResponse = response as? HTTPURLResponse else {
| `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
306 | throw OpenAIError.invalidResponse
307 | }
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:47: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 | guard let httpResponse = response as? HTTPURLResponse else {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
306 | throw OpenAIError.invalidResponse
307 | }
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:309:29: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
307 | }
308 |
309 | switch httpResponse.statusCode {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
310 | case 200...299:
311 | return
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:328:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
326 | throw OpenAIError.apiError(apiError)
327 | }
328 | throw OpenAIError.clientError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
329 | case 500...599:
330 | // Even server errors might have API error details
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:334:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
332 | throw OpenAIError.apiError(apiError)
333 | }
334 | throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
335 | default:
336 | throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:336:69: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
334 | throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
335 | default:
336 | throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
337 | }
338 | }
[12/41] Compiling OpenAIKit OpenAIError.swift
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:14:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
12 | public final class NetworkClient: NetworkClientProtocol, @unchecked Sendable {
13 |
14 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 | private let configuration: Configuration
16 | private let decoder: JSONDecoder
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:246:77: error: cannot find type 'URLRequest' in scope
244 | }
245 |
246 | private func buildURLRequest(from request: any Request) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
247 | let url = configuration.baseURL
248 | .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:266:86: error: cannot find type 'URLRequest' in scope
264 | }
265 |
266 | private func buildStreamingURLRequest(from request: any Request) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
267 | var urlRequest = try await buildURLRequest(from: request)
268 | urlRequest.setValue("text/event-stream", forHTTPHeaderField: "Accept")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:272:89: error: cannot find type 'URLRequest' in scope
270 | }
271 |
272 | private func buildUploadURLRequest(from request: any UploadRequest) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
273 | let url = configuration.baseURL
274 | .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:290:52: error: cannot find type 'URLRequest' in scope
288 | }
289 |
290 | private func configureHeaders(_ request: inout URLRequest) {
| `- error: cannot find type 'URLRequest' in scope
291 | request.setValue("Bearer \(configuration.apiKey)", forHTTPHeaderField: "Authorization")
292 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:304:47: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
302 | }
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
305 | guard let httpResponse = response as? HTTPURLResponse else {
306 | throw OpenAIError.invalidResponse
Foundation.URLResponse:2:18: note: 'URLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:21:60: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
19 | self.configuration = configuration
20 |
21 | let sessionConfiguration = URLSessionConfiguration.default
| `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
22 | sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
23 | sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:24:24: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
22 | sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
23 | sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
24 | self.session = URLSession(configuration: sessionConfiguration)
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
25 |
26 | self.decoder = JSONDecoder()
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:71:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
69 | #else
70 | // macOS/iOS implementation
71 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
72 |
73 | try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:231:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
229 | #else
230 | // macOS/iOS implementation
231 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
232 |
233 | try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:251:26: error: cannot find 'URLRequest' in scope
249 | .appendingPathComponent(request.path)
250 |
251 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
252 | urlRequest.httpMethod = request.method.rawValue
253 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:277:26: error: cannot find 'URLRequest' in scope
275 | .appendingPathComponent(request.path)
276 |
277 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
278 | urlRequest.httpMethod = "POST"
279 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:43: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 | guard let httpResponse = response as? HTTPURLResponse else {
| `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
306 | throw OpenAIError.invalidResponse
307 | }
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:47: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 | guard let httpResponse = response as? HTTPURLResponse else {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
306 | throw OpenAIError.invalidResponse
307 | }
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:309:29: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
307 | }
308 |
309 | switch httpResponse.statusCode {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
310 | case 200...299:
311 | return
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:328:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
326 | throw OpenAIError.apiError(apiError)
327 | }
328 | throw OpenAIError.clientError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
329 | case 500...599:
330 | // Even server errors might have API error details
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:334:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
332 | throw OpenAIError.apiError(apiError)
333 | }
334 | throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
335 | default:
336 | throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:336:69: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
334 | throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
335 | default:
336 | throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
337 | }
338 | }
[13/41] Compiling OpenAIKit Request.swift
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:14:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
12 | public final class NetworkClient: NetworkClientProtocol, @unchecked Sendable {
13 |
14 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 | private let configuration: Configuration
16 | private let decoder: JSONDecoder
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:246:77: error: cannot find type 'URLRequest' in scope
244 | }
245 |
246 | private func buildURLRequest(from request: any Request) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
247 | let url = configuration.baseURL
248 | .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:266:86: error: cannot find type 'URLRequest' in scope
264 | }
265 |
266 | private func buildStreamingURLRequest(from request: any Request) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
267 | var urlRequest = try await buildURLRequest(from: request)
268 | urlRequest.setValue("text/event-stream", forHTTPHeaderField: "Accept")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:272:89: error: cannot find type 'URLRequest' in scope
270 | }
271 |
272 | private func buildUploadURLRequest(from request: any UploadRequest) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
273 | let url = configuration.baseURL
274 | .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:290:52: error: cannot find type 'URLRequest' in scope
288 | }
289 |
290 | private func configureHeaders(_ request: inout URLRequest) {
| `- error: cannot find type 'URLRequest' in scope
291 | request.setValue("Bearer \(configuration.apiKey)", forHTTPHeaderField: "Authorization")
292 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:304:47: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
302 | }
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
305 | guard let httpResponse = response as? HTTPURLResponse else {
306 | throw OpenAIError.invalidResponse
Foundation.URLResponse:2:18: note: 'URLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:21:60: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
19 | self.configuration = configuration
20 |
21 | let sessionConfiguration = URLSessionConfiguration.default
| `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
22 | sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
23 | sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:24:24: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
22 | sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
23 | sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
24 | self.session = URLSession(configuration: sessionConfiguration)
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
25 |
26 | self.decoder = JSONDecoder()
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:71:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
69 | #else
70 | // macOS/iOS implementation
71 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
72 |
73 | try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:231:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
229 | #else
230 | // macOS/iOS implementation
231 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
232 |
233 | try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:251:26: error: cannot find 'URLRequest' in scope
249 | .appendingPathComponent(request.path)
250 |
251 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
252 | urlRequest.httpMethod = request.method.rawValue
253 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:277:26: error: cannot find 'URLRequest' in scope
275 | .appendingPathComponent(request.path)
276 |
277 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
278 | urlRequest.httpMethod = "POST"
279 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:43: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 | guard let httpResponse = response as? HTTPURLResponse else {
| `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
306 | throw OpenAIError.invalidResponse
307 | }
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:47: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 | guard let httpResponse = response as? HTTPURLResponse else {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
306 | throw OpenAIError.invalidResponse
307 | }
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:309:29: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
307 | }
308 |
309 | switch httpResponse.statusCode {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
310 | case 200...299:
311 | return
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:328:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
326 | throw OpenAIError.apiError(apiError)
327 | }
328 | throw OpenAIError.clientError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
329 | case 500...599:
330 | // Even server errors might have API error details
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:334:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
332 | throw OpenAIError.apiError(apiError)
333 | }
334 | throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
335 | default:
336 | throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:336:69: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
334 | throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
335 | default:
336 | throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
337 | }
338 | }
[14/41] Compiling OpenAIKit RetryHandler.swift
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:14:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
12 | public final class NetworkClient: NetworkClientProtocol, @unchecked Sendable {
13 |
14 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 | private let configuration: Configuration
16 | private let decoder: JSONDecoder
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:246:77: error: cannot find type 'URLRequest' in scope
244 | }
245 |
246 | private func buildURLRequest(from request: any Request) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
247 | let url = configuration.baseURL
248 | .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:266:86: error: cannot find type 'URLRequest' in scope
264 | }
265 |
266 | private func buildStreamingURLRequest(from request: any Request) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
267 | var urlRequest = try await buildURLRequest(from: request)
268 | urlRequest.setValue("text/event-stream", forHTTPHeaderField: "Accept")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:272:89: error: cannot find type 'URLRequest' in scope
270 | }
271 |
272 | private func buildUploadURLRequest(from request: any UploadRequest) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
273 | let url = configuration.baseURL
274 | .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:290:52: error: cannot find type 'URLRequest' in scope
288 | }
289 |
290 | private func configureHeaders(_ request: inout URLRequest) {
| `- error: cannot find type 'URLRequest' in scope
291 | request.setValue("Bearer \(configuration.apiKey)", forHTTPHeaderField: "Authorization")
292 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:304:47: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
302 | }
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
305 | guard let httpResponse = response as? HTTPURLResponse else {
306 | throw OpenAIError.invalidResponse
Foundation.URLResponse:2:18: note: 'URLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:21:60: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
19 | self.configuration = configuration
20 |
21 | let sessionConfiguration = URLSessionConfiguration.default
| `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
22 | sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
23 | sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:24:24: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
22 | sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
23 | sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
24 | self.session = URLSession(configuration: sessionConfiguration)
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
25 |
26 | self.decoder = JSONDecoder()
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:71:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
69 | #else
70 | // macOS/iOS implementation
71 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
72 |
73 | try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:231:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
229 | #else
230 | // macOS/iOS implementation
231 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
232 |
233 | try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:251:26: error: cannot find 'URLRequest' in scope
249 | .appendingPathComponent(request.path)
250 |
251 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
252 | urlRequest.httpMethod = request.method.rawValue
253 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:277:26: error: cannot find 'URLRequest' in scope
275 | .appendingPathComponent(request.path)
276 |
277 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
278 | urlRequest.httpMethod = "POST"
279 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:43: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 | guard let httpResponse = response as? HTTPURLResponse else {
| `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
306 | throw OpenAIError.invalidResponse
307 | }
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:47: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 | guard let httpResponse = response as? HTTPURLResponse else {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
306 | throw OpenAIError.invalidResponse
307 | }
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:309:29: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
307 | }
308 |
309 | switch httpResponse.statusCode {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
310 | case 200...299:
311 | return
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:328:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
326 | throw OpenAIError.apiError(apiError)
327 | }
328 | throw OpenAIError.clientError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
329 | case 500...599:
330 | // Even server errors might have API error details
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:334:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
332 | throw OpenAIError.apiError(apiError)
333 | }
334 | throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
335 | default:
336 | throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:336:69: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
334 | throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
335 | default:
336 | throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
337 | }
338 | }
[15/41] Compiling OpenAIKit Responses.swift
[16/41] Compiling OpenAIKit OpenAIKit.swift
[17/41] Compiling OpenAIKit JSONValue.swift
[18/41] Compiling OpenAIKit AssistantsEndpoint.swift
[19/41] Compiling OpenAIKit AudioEndpoint.swift
[20/41] Compiling OpenAIKit BatchEndpoint.swift
[21/41] Compiling OpenAIKit BatchesEndpoint.swift
[22/41] Compiling OpenAIKit Images.swift
[23/41] Compiling OpenAIKit ModelConstants.swift
[24/41] Compiling OpenAIKit Models.swift
[25/41] Compiling OpenAIKit Moderations.swift
[26/41] Compiling OpenAIKit ThreadsEndpoint.swift
[27/41] Compiling OpenAIKit VectorStoresEndpoint.swift
[28/41] Compiling OpenAIKit OpenAIError+UI.swift
[29/41] Compiling OpenAIKit Audio.swift
[30/41] Compiling OpenAIKit ImagesEndpoint.swift
[31/41] Compiling OpenAIKit ModelsEndpoint.swift
[32/41] Compiling OpenAIKit ModerationsEndpoint.swift
[33/41] Compiling OpenAIKit ResponsesEndpoint.swift
[34/41] Compiling OpenAIKit Batch.swift
[35/41] Compiling OpenAIKit Chat.swift
[36/41] Compiling OpenAIKit Embeddings.swift
[37/41] Compiling OpenAIKit Files.swift
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-4606859-2":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:wasm-6.1-latest swift build --swift-sdk wasm32-unknown-wasi 2>&1
wasm-6.1-latest: Pulling from finestructure/spi-images
Digest: sha256:8f9255989265d824b88e7d572b1a334a0dc9b701075ede1970390db95d315c35
Status: Image is up to date for registry.gitlab.com/finestructure/spi-images:wasm-6.1-latest
[0/1] Planning build
[1/1] Compiling plugin Swift-DocC Preview
[2/2] Compiling plugin Swift-DocC
Building for debugging...
[2/7] Write swift-version-24593BA9C3E375BF.txt
[4/36] Compiling OpenAIKit NetworkClient.swift
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:14:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
12 | public final class NetworkClient: NetworkClientProtocol, @unchecked Sendable {
13 |
14 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 | private let configuration: Configuration
16 | private let decoder: JSONDecoder
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:246:77: error: cannot find type 'URLRequest' in scope
244 | }
245 |
246 | private func buildURLRequest(from request: any Request) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
247 | let url = configuration.baseURL
248 | .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:266:86: error: cannot find type 'URLRequest' in scope
264 | }
265 |
266 | private func buildStreamingURLRequest(from request: any Request) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
267 | var urlRequest = try await buildURLRequest(from: request)
268 | urlRequest.setValue("text/event-stream", forHTTPHeaderField: "Accept")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:272:89: error: cannot find type 'URLRequest' in scope
270 | }
271 |
272 | private func buildUploadURLRequest(from request: any UploadRequest) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
273 | let url = configuration.baseURL
274 | .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:290:52: error: cannot find type 'URLRequest' in scope
288 | }
289 |
290 | private func configureHeaders(_ request: inout URLRequest) {
| `- error: cannot find type 'URLRequest' in scope
291 | request.setValue("Bearer \(configuration.apiKey)", forHTTPHeaderField: "Authorization")
292 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:304:47: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
302 | }
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
305 | guard let httpResponse = response as? HTTPURLResponse else {
306 | throw OpenAIError.invalidResponse
Foundation.URLResponse:2:18: note: 'URLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:21:60: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
19 | self.configuration = configuration
20 |
21 | let sessionConfiguration = URLSessionConfiguration.default
| `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
22 | sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
23 | sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:24:24: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
22 | sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
23 | sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
24 | self.session = URLSession(configuration: sessionConfiguration)
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
25 |
26 | self.decoder = JSONDecoder()
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:71:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
69 | #else
70 | // macOS/iOS implementation
71 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
72 |
73 | try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:231:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
229 | #else
230 | // macOS/iOS implementation
231 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
232 |
233 | try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:251:26: error: cannot find 'URLRequest' in scope
249 | .appendingPathComponent(request.path)
250 |
251 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
252 | urlRequest.httpMethod = request.method.rawValue
253 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:277:26: error: cannot find 'URLRequest' in scope
275 | .appendingPathComponent(request.path)
276 |
277 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
278 | urlRequest.httpMethod = "POST"
279 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:43: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 | guard let httpResponse = response as? HTTPURLResponse else {
| `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
306 | throw OpenAIError.invalidResponse
307 | }
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:47: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 | guard let httpResponse = response as? HTTPURLResponse else {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
306 | throw OpenAIError.invalidResponse
307 | }
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:309:29: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
307 | }
308 |
309 | switch httpResponse.statusCode {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
310 | case 200...299:
311 | return
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:328:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
326 | throw OpenAIError.apiError(apiError)
327 | }
328 | throw OpenAIError.clientError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
329 | case 500...599:
330 | // Even server errors might have API error details
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:334:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
332 | throw OpenAIError.apiError(apiError)
333 | }
334 | throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
335 | default:
336 | throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:336:69: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
334 | throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
335 | default:
336 | throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
337 | }
338 | }
[5/36] Compiling OpenAIKit OpenAIError.swift
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:14:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
12 | public final class NetworkClient: NetworkClientProtocol, @unchecked Sendable {
13 |
14 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 | private let configuration: Configuration
16 | private let decoder: JSONDecoder
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:246:77: error: cannot find type 'URLRequest' in scope
244 | }
245 |
246 | private func buildURLRequest(from request: any Request) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
247 | let url = configuration.baseURL
248 | .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:266:86: error: cannot find type 'URLRequest' in scope
264 | }
265 |
266 | private func buildStreamingURLRequest(from request: any Request) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
267 | var urlRequest = try await buildURLRequest(from: request)
268 | urlRequest.setValue("text/event-stream", forHTTPHeaderField: "Accept")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:272:89: error: cannot find type 'URLRequest' in scope
270 | }
271 |
272 | private func buildUploadURLRequest(from request: any UploadRequest) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
273 | let url = configuration.baseURL
274 | .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:290:52: error: cannot find type 'URLRequest' in scope
288 | }
289 |
290 | private func configureHeaders(_ request: inout URLRequest) {
| `- error: cannot find type 'URLRequest' in scope
291 | request.setValue("Bearer \(configuration.apiKey)", forHTTPHeaderField: "Authorization")
292 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:304:47: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
302 | }
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
305 | guard let httpResponse = response as? HTTPURLResponse else {
306 | throw OpenAIError.invalidResponse
Foundation.URLResponse:2:18: note: 'URLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:21:60: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
19 | self.configuration = configuration
20 |
21 | let sessionConfiguration = URLSessionConfiguration.default
| `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
22 | sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
23 | sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:24:24: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
22 | sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
23 | sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
24 | self.session = URLSession(configuration: sessionConfiguration)
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
25 |
26 | self.decoder = JSONDecoder()
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:71:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
69 | #else
70 | // macOS/iOS implementation
71 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
72 |
73 | try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:231:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
229 | #else
230 | // macOS/iOS implementation
231 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
232 |
233 | try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:251:26: error: cannot find 'URLRequest' in scope
249 | .appendingPathComponent(request.path)
250 |
251 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
252 | urlRequest.httpMethod = request.method.rawValue
253 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:277:26: error: cannot find 'URLRequest' in scope
275 | .appendingPathComponent(request.path)
276 |
277 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
278 | urlRequest.httpMethod = "POST"
279 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:43: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 | guard let httpResponse = response as? HTTPURLResponse else {
| `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
306 | throw OpenAIError.invalidResponse
307 | }
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:47: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 | guard let httpResponse = response as? HTTPURLResponse else {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
306 | throw OpenAIError.invalidResponse
307 | }
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:309:29: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
307 | }
308 |
309 | switch httpResponse.statusCode {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
310 | case 200...299:
311 | return
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:328:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
326 | throw OpenAIError.apiError(apiError)
327 | }
328 | throw OpenAIError.clientError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
329 | case 500...599:
330 | // Even server errors might have API error details
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:334:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
332 | throw OpenAIError.apiError(apiError)
333 | }
334 | throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
335 | default:
336 | throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:336:69: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
334 | throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
335 | default:
336 | throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
337 | }
338 | }
[6/36] Compiling OpenAIKit Request.swift
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:14:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
12 | public final class NetworkClient: NetworkClientProtocol, @unchecked Sendable {
13 |
14 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 | private let configuration: Configuration
16 | private let decoder: JSONDecoder
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:246:77: error: cannot find type 'URLRequest' in scope
244 | }
245 |
246 | private func buildURLRequest(from request: any Request) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
247 | let url = configuration.baseURL
248 | .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:266:86: error: cannot find type 'URLRequest' in scope
264 | }
265 |
266 | private func buildStreamingURLRequest(from request: any Request) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
267 | var urlRequest = try await buildURLRequest(from: request)
268 | urlRequest.setValue("text/event-stream", forHTTPHeaderField: "Accept")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:272:89: error: cannot find type 'URLRequest' in scope
270 | }
271 |
272 | private func buildUploadURLRequest(from request: any UploadRequest) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
273 | let url = configuration.baseURL
274 | .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:290:52: error: cannot find type 'URLRequest' in scope
288 | }
289 |
290 | private func configureHeaders(_ request: inout URLRequest) {
| `- error: cannot find type 'URLRequest' in scope
291 | request.setValue("Bearer \(configuration.apiKey)", forHTTPHeaderField: "Authorization")
292 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:304:47: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
302 | }
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
305 | guard let httpResponse = response as? HTTPURLResponse else {
306 | throw OpenAIError.invalidResponse
Foundation.URLResponse:2:18: note: 'URLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:21:60: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
19 | self.configuration = configuration
20 |
21 | let sessionConfiguration = URLSessionConfiguration.default
| `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
22 | sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
23 | sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:24:24: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
22 | sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
23 | sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
24 | self.session = URLSession(configuration: sessionConfiguration)
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
25 |
26 | self.decoder = JSONDecoder()
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:71:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
69 | #else
70 | // macOS/iOS implementation
71 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
72 |
73 | try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:231:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
229 | #else
230 | // macOS/iOS implementation
231 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
232 |
233 | try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:251:26: error: cannot find 'URLRequest' in scope
249 | .appendingPathComponent(request.path)
250 |
251 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
252 | urlRequest.httpMethod = request.method.rawValue
253 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:277:26: error: cannot find 'URLRequest' in scope
275 | .appendingPathComponent(request.path)
276 |
277 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
278 | urlRequest.httpMethod = "POST"
279 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:43: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 | guard let httpResponse = response as? HTTPURLResponse else {
| `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
306 | throw OpenAIError.invalidResponse
307 | }
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:47: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 | guard let httpResponse = response as? HTTPURLResponse else {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
306 | throw OpenAIError.invalidResponse
307 | }
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:309:29: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
307 | }
308 |
309 | switch httpResponse.statusCode {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
310 | case 200...299:
311 | return
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:328:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
326 | throw OpenAIError.apiError(apiError)
327 | }
328 | throw OpenAIError.clientError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
329 | case 500...599:
330 | // Even server errors might have API error details
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:334:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
332 | throw OpenAIError.apiError(apiError)
333 | }
334 | throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
335 | default:
336 | throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:336:69: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
334 | throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
335 | default:
336 | throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
337 | }
338 | }
[7/36] Compiling OpenAIKit RetryHandler.swift
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:14:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
12 | public final class NetworkClient: NetworkClientProtocol, @unchecked Sendable {
13 |
14 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 | private let configuration: Configuration
16 | private let decoder: JSONDecoder
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:246:77: error: cannot find type 'URLRequest' in scope
244 | }
245 |
246 | private func buildURLRequest(from request: any Request) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
247 | let url = configuration.baseURL
248 | .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:266:86: error: cannot find type 'URLRequest' in scope
264 | }
265 |
266 | private func buildStreamingURLRequest(from request: any Request) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
267 | var urlRequest = try await buildURLRequest(from: request)
268 | urlRequest.setValue("text/event-stream", forHTTPHeaderField: "Accept")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:272:89: error: cannot find type 'URLRequest' in scope
270 | }
271 |
272 | private func buildUploadURLRequest(from request: any UploadRequest) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
273 | let url = configuration.baseURL
274 | .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:290:52: error: cannot find type 'URLRequest' in scope
288 | }
289 |
290 | private func configureHeaders(_ request: inout URLRequest) {
| `- error: cannot find type 'URLRequest' in scope
291 | request.setValue("Bearer \(configuration.apiKey)", forHTTPHeaderField: "Authorization")
292 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:304:47: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
302 | }
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
305 | guard let httpResponse = response as? HTTPURLResponse else {
306 | throw OpenAIError.invalidResponse
Foundation.URLResponse:2:18: note: 'URLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:21:60: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
19 | self.configuration = configuration
20 |
21 | let sessionConfiguration = URLSessionConfiguration.default
| `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
22 | sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
23 | sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:24:24: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
22 | sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
23 | sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
24 | self.session = URLSession(configuration: sessionConfiguration)
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
25 |
26 | self.decoder = JSONDecoder()
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:71:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
69 | #else
70 | // macOS/iOS implementation
71 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
72 |
73 | try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:231:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
229 | #else
230 | // macOS/iOS implementation
231 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
232 |
233 | try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:251:26: error: cannot find 'URLRequest' in scope
249 | .appendingPathComponent(request.path)
250 |
251 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
252 | urlRequest.httpMethod = request.method.rawValue
253 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:277:26: error: cannot find 'URLRequest' in scope
275 | .appendingPathComponent(request.path)
276 |
277 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
278 | urlRequest.httpMethod = "POST"
279 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:43: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 | guard let httpResponse = response as? HTTPURLResponse else {
| `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
306 | throw OpenAIError.invalidResponse
307 | }
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:47: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 | guard let httpResponse = response as? HTTPURLResponse else {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
306 | throw OpenAIError.invalidResponse
307 | }
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:309:29: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
307 | }
308 |
309 | switch httpResponse.statusCode {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
310 | case 200...299:
311 | return
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:328:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
326 | throw OpenAIError.apiError(apiError)
327 | }
328 | throw OpenAIError.clientError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
329 | case 500...599:
330 | // Even server errors might have API error details
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:334:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
332 | throw OpenAIError.apiError(apiError)
333 | }
334 | throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
335 | default:
336 | throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:336:69: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
334 | throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
335 | default:
336 | throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
337 | }
338 | }
[8/39] Compiling OpenAIKit ThreadsEndpoint.swift
[9/39] Compiling OpenAIKit VectorStoresEndpoint.swift
[10/39] Compiling OpenAIKit OpenAIError+UI.swift
[11/39] Compiling OpenAIKit Audio.swift
[12/39] Compiling OpenAIKit ChatEndpoint.swift
[13/39] Compiling OpenAIKit EmbeddingsEndpoint.swift
[14/39] Compiling OpenAIKit FilesEndpoint.swift
[15/39] Compiling OpenAIKit FineTuningEndpoint.swift
[16/39] Compiling OpenAIKit ImagesEndpoint.swift
[17/39] Compiling OpenAIKit ModelsEndpoint.swift
[18/39] Compiling OpenAIKit ModerationsEndpoint.swift
[19/39] Compiling OpenAIKit ResponsesEndpoint.swift
[20/39] Compiling OpenAIKit AssistantsEndpoint.swift
[21/39] Compiling OpenAIKit AudioEndpoint.swift
[22/39] Compiling OpenAIKit BatchEndpoint.swift
[23/39] Compiling OpenAIKit BatchesEndpoint.swift
[24/39] Compiling OpenAIKit Images.swift
[25/39] Compiling OpenAIKit ModelConstants.swift
[26/39] Compiling OpenAIKit Models.swift
[27/39] Compiling OpenAIKit Moderations.swift
[28/39] Compiling OpenAIKit Responses.swift
[29/39] Compiling OpenAIKit OpenAIKit.swift
[30/39] Compiling OpenAIKit JSONValue.swift
error: emit-module command failed with exit code 1 (use -v to see invocation)
[31/39] Compiling OpenAIKit Batch.swift
[32/39] Compiling OpenAIKit Chat.swift
[33/39] Compiling OpenAIKit Embeddings.swift
[34/39] Compiling OpenAIKit Files.swift
[35/39] Emitting module OpenAIKit
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:14:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
12 | public final class NetworkClient: NetworkClientProtocol, @unchecked Sendable {
13 |
14 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 | private let configuration: Configuration
16 | private let decoder: JSONDecoder
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:246:77: error: cannot find type 'URLRequest' in scope
244 | }
245 |
246 | private func buildURLRequest(from request: any Request) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
247 | let url = configuration.baseURL
248 | .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:266:86: error: cannot find type 'URLRequest' in scope
264 | }
265 |
266 | private func buildStreamingURLRequest(from request: any Request) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
267 | var urlRequest = try await buildURLRequest(from: request)
268 | urlRequest.setValue("text/event-stream", forHTTPHeaderField: "Accept")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:272:89: error: cannot find type 'URLRequest' in scope
270 | }
271 |
272 | private func buildUploadURLRequest(from request: any UploadRequest) async throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
273 | let url = configuration.baseURL
274 | .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:290:52: error: cannot find type 'URLRequest' in scope
288 | }
289 |
290 | private func configureHeaders(_ request: inout URLRequest) {
| `- error: cannot find type 'URLRequest' in scope
291 | request.setValue("Bearer \(configuration.apiKey)", forHTTPHeaderField: "Authorization")
292 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:304:47: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
302 | }
303 |
304 | private func validateResponse(_ response: URLResponse, data: Data?) throws {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
305 | guard let httpResponse = response as? HTTPURLResponse else {
306 | throw OpenAIError.invalidResponse
Foundation.URLResponse:2:18: note: 'URLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
BUILD FAILURE 6.1 wasm