The Swift Package Index logo.Swift Package Index

Has it really been five years since Swift Package Index launched? Read our anniversary blog post!

Build Information

Failed to build OpenAISwift, reference main (dba18d), with Swift 6.1 for Wasm on 28 May 2025 17:20:55 UTC.

Build Command

bash -c docker run --pull=always --rm -v "checkouts-4609320-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.63.1
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/adamrushy/OpenAISwift.git
Reference: main
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/adamrushy/OpenAISwift
 * branch            main       -> FETCH_HEAD
 * [new branch]      main       -> origin/main
HEAD is now at dba18d7 Merge pull request #113 from underthestars-zhy/main
Cloned https://github.com/adamrushy/OpenAISwift.git
Revision (git rev-parse @):
dba18d7a0cf1dbeb61baaa2a87c2e42b44d71236
SUCCESS checkout https://github.com/adamrushy/OpenAISwift.git at main
========================================
Build
========================================
Selected platform:         wasm
Swift version:             6.1
Building package at path:  $PWD
https://github.com/adamrushy/OpenAISwift.git
https://github.com/adamrushy/OpenAISwift.git
WARNING: environment variable SUPPRESS_SWIFT_6_FLAGS is not set
{
  "dependencies" : [
  ],
  "manifest_display_name" : "OpenAISwift",
  "name" : "OpenAISwift",
  "path" : "/host/spi-builder-workspace",
  "platforms" : [
    {
      "name" : "ios",
      "version" : "15.0"
    },
    {
      "name" : "macos",
      "version" : "10.15"
    }
  ],
  "products" : [
    {
      "name" : "OpenAISwift",
      "targets" : [
        "OpenAISwift"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "OpenAISwiftTests",
      "module_type" : "SwiftTarget",
      "name" : "OpenAISwiftTests",
      "path" : "Tests/OpenAISwiftTests",
      "sources" : [
        "OpenAISwiftTests.swift"
      ],
      "target_dependencies" : [
        "OpenAISwift"
      ],
      "type" : "test"
    },
    {
      "c99name" : "OpenAISwift",
      "module_type" : "SwiftTarget",
      "name" : "OpenAISwift",
      "path" : "Sources/OpenAISwift",
      "product_memberships" : [
        "OpenAISwift"
      ],
      "sources" : [
        "Models/ChatMessage.swift",
        "Models/Command.swift",
        "Models/EmbeddingsInput.swift",
        "Models/ImageGeneration.swift",
        "Models/Instruction.swift",
        "Models/Moderation.swift",
        "Models/OpenAI.swift",
        "Models/OpenAIModelType.swift",
        "OpenAIEndpoint.swift",
        "OpenAISwift.swift",
        "ServerSentEventsHandler.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.5"
}
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-4609320-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:7e37457820e5f17452a98118754f345f2619722c485f2db0d8b666940a83afd2
Status: Image is up to date for registry.gitlab.com/finestructure/spi-images:wasm-6.1-latest
Building for debugging...
[0/2] Write sources
[1/2] Write swift-version-24593BA9C3E375BF.txt
error: emit-module command failed with exit code 1 (use -v to see invocation)
[3/13] Compiling OpenAISwift ChatMessage.swift
[4/13] Compiling OpenAISwift Command.swift
[5/13] Compiling OpenAISwift EmbeddingsInput.swift
[6/13] Compiling OpenAISwift ImageGeneration.swift
[7/13] Compiling OpenAISwift Instruction.swift
[8/13] Compiling OpenAISwift Moderation.swift
[9/13] Compiling OpenAISwift OpenAI.swift
[10/13] Emitting module OpenAISwift
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:10:10: warning: associated value 'chatError(error:)' of 'Sendable'-conforming enum 'OpenAIError' has non-sendable type 'ChatError.Payload'; this is an error in the Swift 6 language mode
  8 |     case genericError(error: Error)
  9 |     case decodingError(error: Error)
 10 |     case chatError(error: ChatError.Payload)
    |          `- warning: associated value 'chatError(error:)' of 'Sendable'-conforming enum 'OpenAIError' has non-sendable type 'ChatError.Payload'; this is an error in the Swift 6 language mode
 11 | }
 12 |
/host/spi-builder-workspace/Sources/OpenAISwift/Models/ChatMessage.swift:117:19: note: consider making struct 'Payload' conform to the 'Sendable' protocol
115 |
116 | public struct ChatError: Codable {
117 |     public struct Payload: Codable {
    |                   `- note: consider making struct 'Payload' conform to the 'Sendable' protocol
118 |         public let message, type: String
119 |         public let param, code: String?
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:22:136: error: cannot find type 'URLRequest' in scope
 20 |         /// Initialiser
 21 |         /// - Parameter session: the session to use for network requests.
 22 |         public init(baseURL: String, endpointPrivider: OpenAIEndpointProvider, session: URLSession, authorizeRequest: @escaping (inout URLRequest) -> Void) {
    |                                                                                                                                        `- error: cannot find type 'URLRequest' in scope
 23 |             self.baseURL = baseURL
 24 |             self.endpointProvider = endpointPrivider
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:22:89: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 20 |         /// Initialiser
 21 |         /// - Parameter session: the session to use for network requests.
 22 |         public init(baseURL: String, endpointPrivider: OpenAIEndpointProvider, session: URLSession, authorizeRequest: @escaping (inout URLRequest) -> Void) {
    |                                                                                         `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 23 |             self.baseURL = baseURL
 24 |             self.endpointProvider = endpointPrivider
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/OpenAISwift/OpenAISwift.swift:30:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 28 |         let baseURL: String
 29 |         let endpointProvider: OpenAIEndpointProvider
 30 |         let session:URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 31 |         let authorizeRequest: (inout URLRequest) -> Void
 32 |
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/OpenAISwift/OpenAISwift.swift:31:38: error: cannot find type 'URLRequest' in scope
 29 |         let endpointProvider: OpenAIEndpointProvider
 30 |         let session:URLSession
 31 |         let authorizeRequest: (inout URLRequest) -> Void
    |                                      `- error: cannot find type 'URLRequest' in scope
 32 |
 33 |         public static func makeDefaultOpenAI(apiKey: String) -> Self {
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:292:39: error: cannot find type 'URLRequest' in scope
290 |     }
291 |
292 |     private func makeRequest(request: URLRequest, completionHandler: @escaping (Result<Data, Error>) -> Void) {
    |                                       `- error: cannot find type 'URLRequest' in scope
293 |         let session = config.session
294 |         let task = session.dataTask(with: request) { (data, response, error) in
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:305:113: error: cannot find type 'URLRequest' in scope
303 |     }
304 |
305 |     private func prepareRequest<BodyType: Encodable>(_ endpoint: OpenAIEndpointProvider.API, body: BodyType) -> URLRequest {
    |                                                                                                                 `- error: cannot find type 'URLRequest' in scope
306 |         var urlComponents = URLComponents(url: URL(string: config.baseURL)!, resolvingAgainstBaseURL: true)
307 |         urlComponents?.path = config.endpointProvider.getPath(api: endpoint)
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:19:31: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |     var onComplete: (() -> Void)?
18 |
19 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
   |                               `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     private var task: URLSessionDataTask?
21 |
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/OpenAISwift/ServerSentEventsHandler.swift:19:44: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
17 |     var onComplete: (() -> Void)?
18 |
19 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
   |                                            `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
20 |     private var task: URLSessionDataTask?
21 |
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:19:71: error: cannot infer contextual base in reference to member 'default'
17 |     var onComplete: (() -> Void)?
18 |
19 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
   |                                                                       `- error: cannot infer contextual base in reference to member 'default'
20 |     private var task: URLSessionDataTask?
21 |
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:19:111: error: 'nil' requires a contextual type
17 |     var onComplete: (() -> Void)?
18 |
19 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
   |                                                                                                               `- error: 'nil' requires a contextual type
20 |     private var task: URLSessionDataTask?
21 |
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:20:23: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
18 |
19 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
20 |     private var task: URLSessionDataTask?
   |                       `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
21 |
22 |     func connect(with request: URLRequest) {
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' 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 URLSessionDataTask = AnyObject
  |                  `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:22:32: error: cannot find type 'URLRequest' in scope
20 |     private var task: URLSessionDataTask?
21 |
22 |     func connect(with request: URLRequest) {
   |                                `- error: cannot find type 'URLRequest' in scope
23 |         task = session.dataTask(with: request)
24 |         task?.resume()
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:41:36: error: cannot find type 'URLSessionDataDelegate' in scope
39 | }
40 |
41 | extension ServerSentEventsHandler: URLSessionDataDelegate {
   |                                    `- error: cannot find type 'URLSessionDataDelegate' in scope
42 |
43 |     /// It will be called several times, each time could return one chunk of data or multiple chunk of data
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:47:32: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
45 |     /// `data: {"id":"chatcmpl-6yVTvD6UAXsE9uG2SmW4Tc2iuFnnT","object":"chat.completion.chunk","created":1679878715,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"role":"assistant"},"index":0,"finish_reason":null}]}`
46 |     /// `data: {"id":"chatcmpl-6yVTvD6UAXsE9uG2SmW4Tc2iuFnnT","object":"chat.completion.chunk","created":1679878715,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"Once"},"index":0,"finish_reason":null}]}`
47 |     func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
   |                                `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
48 |         if let eventString = String(data: data, encoding: .utf8) {
49 |             let lines = eventString.split(separator: "\n")
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/OpenAISwift/ServerSentEventsHandler.swift:47:54: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
45 |     /// `data: {"id":"chatcmpl-6yVTvD6UAXsE9uG2SmW4Tc2iuFnnT","object":"chat.completion.chunk","created":1679878715,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"role":"assistant"},"index":0,"finish_reason":null}]}`
46 |     /// `data: {"id":"chatcmpl-6yVTvD6UAXsE9uG2SmW4Tc2iuFnnT","object":"chat.completion.chunk","created":1679878715,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"Once"},"index":0,"finish_reason":null}]}`
47 |     func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
   |                                                      `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
48 |         if let eventString = String(data: data, encoding: .utf8) {
49 |             let lines = eventString.split(separator: "\n")
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' 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 URLSessionDataTask = AnyObject
  |                  `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:62:32: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
60 |     }
61 |
62 |     func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
   |                                `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
63 |         if let error = error {
64 |             onEventReceived?(.failure(.genericError(error: error)))
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/OpenAISwift/ServerSentEventsHandler.swift:62:50: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
60 |     }
61 |
62 |     func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
   |                                                  `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
63 |         if let error = error {
64 |             onEventReceived?(.failure(.genericError(error: error)))
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' 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 URLSessionTask = AnyObject
  |                  `- note: 'URLSessionTask' has been explicitly marked unavailable here
[11/14] Compiling OpenAISwift OpenAIModelType.swift
[12/14] Compiling OpenAISwift OpenAIEndpoint.swift
[13/14] Compiling OpenAISwift OpenAISwift.swift
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:10:10: warning: associated value 'chatError(error:)' of 'Sendable'-conforming enum 'OpenAIError' has non-sendable type 'ChatError.Payload'; this is an error in the Swift 6 language mode
  8 |     case genericError(error: Error)
  9 |     case decodingError(error: Error)
 10 |     case chatError(error: ChatError.Payload)
    |          `- warning: associated value 'chatError(error:)' of 'Sendable'-conforming enum 'OpenAIError' has non-sendable type 'ChatError.Payload'; this is an error in the Swift 6 language mode
 11 | }
 12 |
/host/spi-builder-workspace/Sources/OpenAISwift/Models/ChatMessage.swift:117:19: note: consider making struct 'Payload' conform to the 'Sendable' protocol
115 |
116 | public struct ChatError: Codable {
117 |     public struct Payload: Codable {
    |                   `- note: consider making struct 'Payload' conform to the 'Sendable' protocol
118 |         public let message, type: String
119 |         public let param, code: String?
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:22:136: error: cannot find type 'URLRequest' in scope
 20 |         /// Initialiser
 21 |         /// - Parameter session: the session to use for network requests.
 22 |         public init(baseURL: String, endpointPrivider: OpenAIEndpointProvider, session: URLSession, authorizeRequest: @escaping (inout URLRequest) -> Void) {
    |                                                                                                                                        `- error: cannot find type 'URLRequest' in scope
 23 |             self.baseURL = baseURL
 24 |             self.endpointProvider = endpointPrivider
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:22:89: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 20 |         /// Initialiser
 21 |         /// - Parameter session: the session to use for network requests.
 22 |         public init(baseURL: String, endpointPrivider: OpenAIEndpointProvider, session: URLSession, authorizeRequest: @escaping (inout URLRequest) -> Void) {
    |                                                                                         `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 23 |             self.baseURL = baseURL
 24 |             self.endpointProvider = endpointPrivider
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/OpenAISwift/OpenAISwift.swift:30:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 28 |         let baseURL: String
 29 |         let endpointProvider: OpenAIEndpointProvider
 30 |         let session:URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 31 |         let authorizeRequest: (inout URLRequest) -> Void
 32 |
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/OpenAISwift/OpenAISwift.swift:31:38: error: cannot find type 'URLRequest' in scope
 29 |         let endpointProvider: OpenAIEndpointProvider
 30 |         let session:URLSession
 31 |         let authorizeRequest: (inout URLRequest) -> Void
    |                                      `- error: cannot find type 'URLRequest' in scope
 32 |
 33 |         public static func makeDefaultOpenAI(apiKey: String) -> Self {
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:292:39: error: cannot find type 'URLRequest' in scope
290 |     }
291 |
292 |     private func makeRequest(request: URLRequest, completionHandler: @escaping (Result<Data, Error>) -> Void) {
    |                                       `- error: cannot find type 'URLRequest' in scope
293 |         let session = config.session
294 |         let task = session.dataTask(with: request) { (data, response, error) in
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:305:113: error: cannot find type 'URLRequest' in scope
303 |     }
304 |
305 |     private func prepareRequest<BodyType: Encodable>(_ endpoint: OpenAIEndpointProvider.API, body: BodyType) -> URLRequest {
    |                                                                                                                 `- error: cannot find type 'URLRequest' in scope
306 |         var urlComponents = URLComponents(url: URL(string: config.baseURL)!, resolvingAgainstBaseURL: true)
307 |         urlComponents?.path = config.endpointProvider.getPath(api: endpoint)
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:36:29: error: cannot infer contextual base in reference to member 'shared'
 34 |             .init(baseURL: "https://api.openai.com",
 35 |                   endpointPrivider: OpenAIEndpointProvider(source: .openAI),
 36 |                   session: .shared,
    |                             `- error: cannot infer contextual base in reference to member 'shared'
 37 |                   authorizeRequest: { request in
 38 |                     request.setValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:22:32: error: cannot find type 'URLRequest' in scope
20 |     private var task: URLSessionDataTask?
21 |
22 |     func connect(with request: URLRequest) {
   |                                `- error: cannot find type 'URLRequest' in scope
23 |         task = session.dataTask(with: request)
24 |         task?.resume()
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:294:28: error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
292 |     private func makeRequest(request: URLRequest, completionHandler: @escaping (Result<Data, Error>) -> Void) {
293 |         let session = config.session
294 |         let task = session.dataTask(with: request) { (data, response, error) in
    |                            `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
295 |             if let error = error {
296 |                 completionHandler(.failure(error))
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:308:23: error: cannot find 'URLRequest' in scope
306 |         var urlComponents = URLComponents(url: URL(string: config.baseURL)!, resolvingAgainstBaseURL: true)
307 |         urlComponents?.path = config.endpointProvider.getPath(api: endpoint)
308 |         var request = URLRequest(url: urlComponents!.url!)
    |                       `- error: cannot find 'URLRequest' in scope
309 |         request.httpMethod = config.endpointProvider.getMethod(api: endpoint)
310 |
[14/14] Compiling OpenAISwift ServerSentEventsHandler.swift
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:19:31: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |     var onComplete: (() -> Void)?
18 |
19 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
   |                               `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     private var task: URLSessionDataTask?
21 |
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/OpenAISwift/ServerSentEventsHandler.swift:19:44: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
17 |     var onComplete: (() -> Void)?
18 |
19 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
   |                                            `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
20 |     private var task: URLSessionDataTask?
21 |
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:19:71: error: cannot infer contextual base in reference to member 'default'
17 |     var onComplete: (() -> Void)?
18 |
19 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
   |                                                                       `- error: cannot infer contextual base in reference to member 'default'
20 |     private var task: URLSessionDataTask?
21 |
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:19:111: error: 'nil' requires a contextual type
17 |     var onComplete: (() -> Void)?
18 |
19 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
   |                                                                                                               `- error: 'nil' requires a contextual type
20 |     private var task: URLSessionDataTask?
21 |
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:20:23: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
18 |
19 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
20 |     private var task: URLSessionDataTask?
   |                       `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
21 |
22 |     func connect(with request: URLRequest) {
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' 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 URLSessionDataTask = AnyObject
  |                  `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:22:32: error: cannot find type 'URLRequest' in scope
20 |     private var task: URLSessionDataTask?
21 |
22 |     func connect(with request: URLRequest) {
   |                                `- error: cannot find type 'URLRequest' in scope
23 |         task = session.dataTask(with: request)
24 |         task?.resume()
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:41:36: error: cannot find type 'URLSessionDataDelegate' in scope
39 | }
40 |
41 | extension ServerSentEventsHandler: URLSessionDataDelegate {
   |                                    `- error: cannot find type 'URLSessionDataDelegate' in scope
42 |
43 |     /// It will be called several times, each time could return one chunk of data or multiple chunk of data
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:47:32: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
45 |     /// `data: {"id":"chatcmpl-6yVTvD6UAXsE9uG2SmW4Tc2iuFnnT","object":"chat.completion.chunk","created":1679878715,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"role":"assistant"},"index":0,"finish_reason":null}]}`
46 |     /// `data: {"id":"chatcmpl-6yVTvD6UAXsE9uG2SmW4Tc2iuFnnT","object":"chat.completion.chunk","created":1679878715,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"Once"},"index":0,"finish_reason":null}]}`
47 |     func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
   |                                `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
48 |         if let eventString = String(data: data, encoding: .utf8) {
49 |             let lines = eventString.split(separator: "\n")
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/OpenAISwift/ServerSentEventsHandler.swift:47:54: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
45 |     /// `data: {"id":"chatcmpl-6yVTvD6UAXsE9uG2SmW4Tc2iuFnnT","object":"chat.completion.chunk","created":1679878715,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"role":"assistant"},"index":0,"finish_reason":null}]}`
46 |     /// `data: {"id":"chatcmpl-6yVTvD6UAXsE9uG2SmW4Tc2iuFnnT","object":"chat.completion.chunk","created":1679878715,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"Once"},"index":0,"finish_reason":null}]}`
47 |     func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
   |                                                      `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
48 |         if let eventString = String(data: data, encoding: .utf8) {
49 |             let lines = eventString.split(separator: "\n")
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' 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 URLSessionDataTask = AnyObject
  |                  `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:62:32: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
60 |     }
61 |
62 |     func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
   |                                `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
63 |         if let error = error {
64 |             onEventReceived?(.failure(.genericError(error: error)))
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/OpenAISwift/ServerSentEventsHandler.swift:62:50: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
60 |     }
61 |
62 |     func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
   |                                                  `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
63 |         if let error = error {
64 |             onEventReceived?(.failure(.genericError(error: error)))
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' 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 URLSessionTask = AnyObject
  |                  `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:23:24: error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
21 |
22 |     func connect(with request: URLRequest) {
23 |         task = session.dataTask(with: request)
   |                        `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
24 |         task?.resume()
25 |     }
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:24:15: error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'resume'
22 |     func connect(with request: URLRequest) {
23 |         task = session.dataTask(with: request)
24 |         task?.resume()
   |               `- error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'resume'
25 |     }
26 |
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:28:15: error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'cancel'
26 |
27 |     func disconnect() {
28 |         task?.cancel()
   |               `- error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'cancel'
29 |     }
30 |
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-4609320-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:7e37457820e5f17452a98118754f345f2619722c485f2db0d8b666940a83afd2
Status: Image is up to date for registry.gitlab.com/finestructure/spi-images:wasm-6.1-latest
[0/1] Planning build
Building for debugging...
[0/1] Write swift-version-24593BA9C3E375BF.txt
[2/12] Compiling OpenAISwift OpenAISwift.swift
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:22:136: error: cannot find type 'URLRequest' in scope
 20 |         /// Initialiser
 21 |         /// - Parameter session: the session to use for network requests.
 22 |         public init(baseURL: String, endpointPrivider: OpenAIEndpointProvider, session: URLSession, authorizeRequest: @escaping (inout URLRequest) -> Void) {
    |                                                                                                                                        `- error: cannot find type 'URLRequest' in scope
 23 |             self.baseURL = baseURL
 24 |             self.endpointProvider = endpointPrivider
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:22:89: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 20 |         /// Initialiser
 21 |         /// - Parameter session: the session to use for network requests.
 22 |         public init(baseURL: String, endpointPrivider: OpenAIEndpointProvider, session: URLSession, authorizeRequest: @escaping (inout URLRequest) -> Void) {
    |                                                                                         `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 23 |             self.baseURL = baseURL
 24 |             self.endpointProvider = endpointPrivider
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/OpenAISwift/OpenAISwift.swift:30:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 28 |         let baseURL: String
 29 |         let endpointProvider: OpenAIEndpointProvider
 30 |         let session:URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 31 |         let authorizeRequest: (inout URLRequest) -> Void
 32 |
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/OpenAISwift/OpenAISwift.swift:31:38: error: cannot find type 'URLRequest' in scope
 29 |         let endpointProvider: OpenAIEndpointProvider
 30 |         let session:URLSession
 31 |         let authorizeRequest: (inout URLRequest) -> Void
    |                                      `- error: cannot find type 'URLRequest' in scope
 32 |
 33 |         public static func makeDefaultOpenAI(apiKey: String) -> Self {
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:292:39: error: cannot find type 'URLRequest' in scope
290 |     }
291 |
292 |     private func makeRequest(request: URLRequest, completionHandler: @escaping (Result<Data, Error>) -> Void) {
    |                                       `- error: cannot find type 'URLRequest' in scope
293 |         let session = config.session
294 |         let task = session.dataTask(with: request) { (data, response, error) in
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:305:113: error: cannot find type 'URLRequest' in scope
303 |     }
304 |
305 |     private func prepareRequest<BodyType: Encodable>(_ endpoint: OpenAIEndpointProvider.API, body: BodyType) -> URLRequest {
    |                                                                                                                 `- error: cannot find type 'URLRequest' in scope
306 |         var urlComponents = URLComponents(url: URL(string: config.baseURL)!, resolvingAgainstBaseURL: true)
307 |         urlComponents?.path = config.endpointProvider.getPath(api: endpoint)
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:36:29: error: cannot infer contextual base in reference to member 'shared'
 34 |             .init(baseURL: "https://api.openai.com",
 35 |                   endpointPrivider: OpenAIEndpointProvider(source: .openAI),
 36 |                   session: .shared,
    |                             `- error: cannot infer contextual base in reference to member 'shared'
 37 |                   authorizeRequest: { request in
 38 |                     request.setValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:22:32: error: cannot find type 'URLRequest' in scope
20 |     private var task: URLSessionDataTask?
21 |
22 |     func connect(with request: URLRequest) {
   |                                `- error: cannot find type 'URLRequest' in scope
23 |         task = session.dataTask(with: request)
24 |         task?.resume()
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:294:28: error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
292 |     private func makeRequest(request: URLRequest, completionHandler: @escaping (Result<Data, Error>) -> Void) {
293 |         let session = config.session
294 |         let task = session.dataTask(with: request) { (data, response, error) in
    |                            `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
295 |             if let error = error {
296 |                 completionHandler(.failure(error))
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:308:23: error: cannot find 'URLRequest' in scope
306 |         var urlComponents = URLComponents(url: URL(string: config.baseURL)!, resolvingAgainstBaseURL: true)
307 |         urlComponents?.path = config.endpointProvider.getPath(api: endpoint)
308 |         var request = URLRequest(url: urlComponents!.url!)
    |                       `- error: cannot find 'URLRequest' in scope
309 |         request.httpMethod = config.endpointProvider.getMethod(api: endpoint)
310 |
[3/13] Compiling OpenAISwift OpenAIEndpoint.swift
[4/13] Compiling OpenAISwift ServerSentEventsHandler.swift
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:19:31: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |     var onComplete: (() -> Void)?
18 |
19 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
   |                               `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     private var task: URLSessionDataTask?
21 |
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/OpenAISwift/ServerSentEventsHandler.swift:19:44: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
17 |     var onComplete: (() -> Void)?
18 |
19 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
   |                                            `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
20 |     private var task: URLSessionDataTask?
21 |
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:19:71: error: cannot infer contextual base in reference to member 'default'
17 |     var onComplete: (() -> Void)?
18 |
19 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
   |                                                                       `- error: cannot infer contextual base in reference to member 'default'
20 |     private var task: URLSessionDataTask?
21 |
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:19:111: error: 'nil' requires a contextual type
17 |     var onComplete: (() -> Void)?
18 |
19 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
   |                                                                                                               `- error: 'nil' requires a contextual type
20 |     private var task: URLSessionDataTask?
21 |
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:20:23: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
18 |
19 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
20 |     private var task: URLSessionDataTask?
   |                       `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
21 |
22 |     func connect(with request: URLRequest) {
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' 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 URLSessionDataTask = AnyObject
  |                  `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:22:32: error: cannot find type 'URLRequest' in scope
20 |     private var task: URLSessionDataTask?
21 |
22 |     func connect(with request: URLRequest) {
   |                                `- error: cannot find type 'URLRequest' in scope
23 |         task = session.dataTask(with: request)
24 |         task?.resume()
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:41:36: error: cannot find type 'URLSessionDataDelegate' in scope
39 | }
40 |
41 | extension ServerSentEventsHandler: URLSessionDataDelegate {
   |                                    `- error: cannot find type 'URLSessionDataDelegate' in scope
42 |
43 |     /// It will be called several times, each time could return one chunk of data or multiple chunk of data
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:47:32: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
45 |     /// `data: {"id":"chatcmpl-6yVTvD6UAXsE9uG2SmW4Tc2iuFnnT","object":"chat.completion.chunk","created":1679878715,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"role":"assistant"},"index":0,"finish_reason":null}]}`
46 |     /// `data: {"id":"chatcmpl-6yVTvD6UAXsE9uG2SmW4Tc2iuFnnT","object":"chat.completion.chunk","created":1679878715,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"Once"},"index":0,"finish_reason":null}]}`
47 |     func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
   |                                `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
48 |         if let eventString = String(data: data, encoding: .utf8) {
49 |             let lines = eventString.split(separator: "\n")
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/OpenAISwift/ServerSentEventsHandler.swift:47:54: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
45 |     /// `data: {"id":"chatcmpl-6yVTvD6UAXsE9uG2SmW4Tc2iuFnnT","object":"chat.completion.chunk","created":1679878715,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"role":"assistant"},"index":0,"finish_reason":null}]}`
46 |     /// `data: {"id":"chatcmpl-6yVTvD6UAXsE9uG2SmW4Tc2iuFnnT","object":"chat.completion.chunk","created":1679878715,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"Once"},"index":0,"finish_reason":null}]}`
47 |     func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
   |                                                      `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
48 |         if let eventString = String(data: data, encoding: .utf8) {
49 |             let lines = eventString.split(separator: "\n")
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' 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 URLSessionDataTask = AnyObject
  |                  `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:62:32: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
60 |     }
61 |
62 |     func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
   |                                `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
63 |         if let error = error {
64 |             onEventReceived?(.failure(.genericError(error: error)))
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/OpenAISwift/ServerSentEventsHandler.swift:62:50: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
60 |     }
61 |
62 |     func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
   |                                                  `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
63 |         if let error = error {
64 |             onEventReceived?(.failure(.genericError(error: error)))
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' 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 URLSessionTask = AnyObject
  |                  `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:23:24: error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
21 |
22 |     func connect(with request: URLRequest) {
23 |         task = session.dataTask(with: request)
   |                        `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
24 |         task?.resume()
25 |     }
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:24:15: error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'resume'
22 |     func connect(with request: URLRequest) {
23 |         task = session.dataTask(with: request)
24 |         task?.resume()
   |               `- error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'resume'
25 |     }
26 |
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:28:15: error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'cancel'
26 |
27 |     func disconnect() {
28 |         task?.cancel()
   |               `- error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'cancel'
29 |     }
30 |
[5/13] Compiling OpenAISwift OpenAIModelType.swift
[6/13] Compiling OpenAISwift Instruction.swift
[7/13] Compiling OpenAISwift Moderation.swift
[8/13] Compiling OpenAISwift OpenAI.swift
error: emit-module command failed with exit code 1 (use -v to see invocation)
[9/13] Compiling OpenAISwift EmbeddingsInput.swift
[10/13] Compiling OpenAISwift ImageGeneration.swift
[11/13] Compiling OpenAISwift ChatMessage.swift
[12/13] Compiling OpenAISwift Command.swift
[13/13] Emitting module OpenAISwift
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:22:136: error: cannot find type 'URLRequest' in scope
 20 |         /// Initialiser
 21 |         /// - Parameter session: the session to use for network requests.
 22 |         public init(baseURL: String, endpointPrivider: OpenAIEndpointProvider, session: URLSession, authorizeRequest: @escaping (inout URLRequest) -> Void) {
    |                                                                                                                                        `- error: cannot find type 'URLRequest' in scope
 23 |             self.baseURL = baseURL
 24 |             self.endpointProvider = endpointPrivider
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:22:89: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 20 |         /// Initialiser
 21 |         /// - Parameter session: the session to use for network requests.
 22 |         public init(baseURL: String, endpointPrivider: OpenAIEndpointProvider, session: URLSession, authorizeRequest: @escaping (inout URLRequest) -> Void) {
    |                                                                                         `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 23 |             self.baseURL = baseURL
 24 |             self.endpointProvider = endpointPrivider
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/OpenAISwift/OpenAISwift.swift:30:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 28 |         let baseURL: String
 29 |         let endpointProvider: OpenAIEndpointProvider
 30 |         let session:URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 31 |         let authorizeRequest: (inout URLRequest) -> Void
 32 |
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/OpenAISwift/OpenAISwift.swift:31:38: error: cannot find type 'URLRequest' in scope
 29 |         let endpointProvider: OpenAIEndpointProvider
 30 |         let session:URLSession
 31 |         let authorizeRequest: (inout URLRequest) -> Void
    |                                      `- error: cannot find type 'URLRequest' in scope
 32 |
 33 |         public static func makeDefaultOpenAI(apiKey: String) -> Self {
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:292:39: error: cannot find type 'URLRequest' in scope
290 |     }
291 |
292 |     private func makeRequest(request: URLRequest, completionHandler: @escaping (Result<Data, Error>) -> Void) {
    |                                       `- error: cannot find type 'URLRequest' in scope
293 |         let session = config.session
294 |         let task = session.dataTask(with: request) { (data, response, error) in
/host/spi-builder-workspace/Sources/OpenAISwift/OpenAISwift.swift:305:113: error: cannot find type 'URLRequest' in scope
303 |     }
304 |
305 |     private func prepareRequest<BodyType: Encodable>(_ endpoint: OpenAIEndpointProvider.API, body: BodyType) -> URLRequest {
    |                                                                                                                 `- error: cannot find type 'URLRequest' in scope
306 |         var urlComponents = URLComponents(url: URL(string: config.baseURL)!, resolvingAgainstBaseURL: true)
307 |         urlComponents?.path = config.endpointProvider.getPath(api: endpoint)
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:19:31: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |     var onComplete: (() -> Void)?
18 |
19 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
   |                               `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     private var task: URLSessionDataTask?
21 |
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/OpenAISwift/ServerSentEventsHandler.swift:19:44: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
17 |     var onComplete: (() -> Void)?
18 |
19 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
   |                                            `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
20 |     private var task: URLSessionDataTask?
21 |
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:19:71: error: cannot infer contextual base in reference to member 'default'
17 |     var onComplete: (() -> Void)?
18 |
19 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
   |                                                                       `- error: cannot infer contextual base in reference to member 'default'
20 |     private var task: URLSessionDataTask?
21 |
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:19:111: error: 'nil' requires a contextual type
17 |     var onComplete: (() -> Void)?
18 |
19 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
   |                                                                                                               `- error: 'nil' requires a contextual type
20 |     private var task: URLSessionDataTask?
21 |
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:20:23: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
18 |
19 |     private lazy var session: URLSession = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
20 |     private var task: URLSessionDataTask?
   |                       `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
21 |
22 |     func connect(with request: URLRequest) {
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' 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 URLSessionDataTask = AnyObject
  |                  `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:22:32: error: cannot find type 'URLRequest' in scope
20 |     private var task: URLSessionDataTask?
21 |
22 |     func connect(with request: URLRequest) {
   |                                `- error: cannot find type 'URLRequest' in scope
23 |         task = session.dataTask(with: request)
24 |         task?.resume()
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:41:36: error: cannot find type 'URLSessionDataDelegate' in scope
39 | }
40 |
41 | extension ServerSentEventsHandler: URLSessionDataDelegate {
   |                                    `- error: cannot find type 'URLSessionDataDelegate' in scope
42 |
43 |     /// It will be called several times, each time could return one chunk of data or multiple chunk of data
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:47:32: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
45 |     /// `data: {"id":"chatcmpl-6yVTvD6UAXsE9uG2SmW4Tc2iuFnnT","object":"chat.completion.chunk","created":1679878715,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"role":"assistant"},"index":0,"finish_reason":null}]}`
46 |     /// `data: {"id":"chatcmpl-6yVTvD6UAXsE9uG2SmW4Tc2iuFnnT","object":"chat.completion.chunk","created":1679878715,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"Once"},"index":0,"finish_reason":null}]}`
47 |     func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
   |                                `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
48 |         if let eventString = String(data: data, encoding: .utf8) {
49 |             let lines = eventString.split(separator: "\n")
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/OpenAISwift/ServerSentEventsHandler.swift:47:54: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
45 |     /// `data: {"id":"chatcmpl-6yVTvD6UAXsE9uG2SmW4Tc2iuFnnT","object":"chat.completion.chunk","created":1679878715,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"role":"assistant"},"index":0,"finish_reason":null}]}`
46 |     /// `data: {"id":"chatcmpl-6yVTvD6UAXsE9uG2SmW4Tc2iuFnnT","object":"chat.completion.chunk","created":1679878715,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"Once"},"index":0,"finish_reason":null}]}`
47 |     func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
   |                                                      `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
48 |         if let eventString = String(data: data, encoding: .utf8) {
49 |             let lines = eventString.split(separator: "\n")
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' 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 URLSessionDataTask = AnyObject
  |                  `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/OpenAISwift/ServerSentEventsHandler.swift:62:32: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
60 |     }
61 |
62 |     func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
   |                                `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
63 |         if let error = error {
64 |             onEventReceived?(.failure(.genericError(error: error)))
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/OpenAISwift/ServerSentEventsHandler.swift:62:50: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
60 |     }
61 |
62 |     func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
   |                                                  `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
63 |         if let error = error {
64 |             onEventReceived?(.failure(.genericError(error: error)))
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' 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 URLSessionTask = AnyObject
  |                  `- note: 'URLSessionTask' has been explicitly marked unavailable here
BUILD FAILURE 6.1 wasm