Build Information
Failed to build FoundationModelsKit, reference main (a30036), with Swift 6.2 for Linux on 24 Oct 2026 12:46:58 UTC.
Build Command
bash -c docker run --pull=always --rm -v "checkouts-53886769-0":/host -w "$PWD" -e JAVA_HOME="/root/.sdkman/candidates/java/current" -e SPI_BUILD="1" -e SPI_PROCESSING="1" registry.gitlab.com/saguaro1/spi-images:linux-6.2-latest swift build --triple x86_64-unknown-linux-gnu 2>&1Build Log
========================================
RunAll
========================================
Builder version: 5.1.3
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/divyaravitech/FoundationModelsKit.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/divyaravitech/FoundationModelsKit
* branch main -> FETCH_HEAD
* [new branch] main -> origin/main
HEAD is now at a300367 Merge pull request #8 from divyaravitech/dependabot/github_actions/actions-640176b5ab
Cloned https://github.com/divyaravitech/FoundationModelsKit.git
Revision (git rev-parse @):
a3003675560359e5ee40ca33b582c6e1ff41436e
SPI manifest file found: $PWD/.spi.yml
SUCCESS checkout https://github.com/divyaravitech/FoundationModelsKit.git at main
========================================
Build
========================================
Selected platform: linux
Swift version: 6.2
Building package at path: $PWD
https://github.com/divyaravitech/FoundationModelsKit.git
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-53886769-0":/host -w "$PWD" -e JAVA_HOME="/root/.sdkman/candidates/java/current" -e SPI_BUILD="1" -e SPI_PROCESSING="1" registry.gitlab.com/saguaro1/spi-images:linux-6.2-latest swift build --triple x86_64-unknown-linux-gnu 2>&1
linux-6.2-latest: Pulling from saguaro1/spi-images
Digest: sha256:fb5d8fda777a26ddf92a54d8d0a4928674c7f15e70feba2d3a729a0a6d9cf40c
Status: Image is up to date for registry.gitlab.com/saguaro1/spi-images:linux-6.2-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/18] Emitting module FoundationModelsKit
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:70:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
68 |
69 | private let config: AnthropicConfiguration
70 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
71 | private let tools: ToolRegistry
72 |
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/FoundationModelsKit/AnthropicLanguageModel.swift:80:18: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
78 | config: AnthropicConfiguration,
79 | tools: [any ModelTool] = [],
80 | session: URLSession = .shared
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
81 | ) {
82 | self.config = config
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/FoundationModelsKit/AnthropicLanguageModel.swift:80:32: error: value of type '_' expected to be instance of class or class-constrained type
78 | config: AnthropicConfiguration,
79 | tools: [any ModelTool] = [],
80 | session: URLSession = .shared
| `- error: value of type '_' expected to be instance of class or class-constrained type
81 | ) {
82 | self.config = config
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:80:32: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
78 | config: AnthropicConfiguration,
79 | tools: [any ModelTool] = [],
80 | session: URLSession = .shared
| `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
81 | ) {
82 | self.config = config
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:165:81: error: cannot find type 'URLRequest' in scope
163 | // MARK: - Private helpers
164 |
165 | private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
166 | try makeRequest(messages: [["role": "user", "content": request.content]], stream: stream)
167 | }
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:169:81: error: cannot find type 'URLRequest' in scope
167 | }
168 |
169 | private func makeRequest(messages: [[String: Any]], stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
170 | let url = config.baseURL.appendingPathComponent("v1/messages")
171 | var urlRequest = URLRequest(url: url)
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:202:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
200 | }
201 |
202 | private func validate(response: URLResponse, data: Data?) throws {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
203 | guard let http = response as? HTTPURLResponse else { return }
204 | guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/AnthropicLanguageModel.swift:70:17: error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicLanguageModel' has non-Sendable type 'URLSession' (aka 'AnyObject')
68 |
69 | private let config: AnthropicConfiguration
70 | private let session: URLSession
| `- error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicLanguageModel' has non-Sendable type 'URLSession' (aka 'AnyObject')
71 | private let tools: ToolRegistry
72 |
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:44:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
42 |
43 | private let config: GeminiConfiguration
44 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
45 |
46 | public init(config: GeminiConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/GeminiLanguageModel.swift:46:55: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
44 | private let session: URLSession
45 |
46 | public init(config: GeminiConfiguration, session: URLSession = .shared) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
47 | self.config = config
48 | self.session = session
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/FoundationModelsKit/GeminiLanguageModel.swift:46:69: error: value of type '_' expected to be instance of class or class-constrained type
44 | private let session: URLSession
45 |
46 | public init(config: GeminiConfiguration, session: URLSession = .shared) {
| `- error: value of type '_' expected to be instance of class or class-constrained type
47 | self.config = config
48 | self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:46:69: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
44 | private let session: URLSession
45 |
46 | public init(config: GeminiConfiguration, session: URLSession = .shared) {
| `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
47 | self.config = config
48 | self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:93:81: error: cannot find type 'URLRequest' in scope
91 | }
92 |
93 | private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
94 | let method = stream ? "streamGenerateContent" : "generateContent"
95 | var components = URLComponents(
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:117:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
115 | }
116 |
117 | private func validate(response: URLResponse, data: Data?) throws {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
118 | guard let http = response as? HTTPURLResponse else { return }
119 | guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/GeminiLanguageModel.swift:44:17: error: stored property 'session' of 'Sendable'-conforming struct 'GeminiLanguageModel' has non-Sendable type 'URLSession' (aka 'AnyObject')
42 |
43 | private let config: GeminiConfiguration
44 | private let session: URLSession
| `- error: stored property 'session' of 'Sendable'-conforming struct 'GeminiLanguageModel' has non-Sendable type 'URLSession' (aka 'AnyObject')
45 |
46 | public init(config: GeminiConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:44:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
42 |
43 | private let config: OpenAIConfiguration
44 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
45 |
46 | public init(config: OpenAIConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/OpenAILanguageModel.swift:46:55: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
44 | private let session: URLSession
45 |
46 | public init(config: OpenAIConfiguration, session: URLSession = .shared) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
47 | self.config = config
48 | self.session = session
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/FoundationModelsKit/OpenAILanguageModel.swift:46:69: error: value of type '_' expected to be instance of class or class-constrained type
44 | private let session: URLSession
45 |
46 | public init(config: OpenAIConfiguration, session: URLSession = .shared) {
| `- error: value of type '_' expected to be instance of class or class-constrained type
47 | self.config = config
48 | self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:46:69: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
44 | private let session: URLSession
45 |
46 | public init(config: OpenAIConfiguration, session: URLSession = .shared) {
| `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
47 | self.config = config
48 | self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:93:81: error: cannot find type 'URLRequest' in scope
91 | }
92 |
93 | private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
94 | var urlRequest = URLRequest(url: config.baseURL.appendingPathComponent("v1/chat/completions"))
95 | urlRequest.httpMethod = "POST"
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:110:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
108 | }
109 |
110 | private func validate(response: URLResponse, data: Data?) throws {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
111 | guard let http = response as? HTTPURLResponse else { return }
112 | guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/OpenAILanguageModel.swift:44:17: error: stored property 'session' of 'Sendable'-conforming struct 'OpenAILanguageModel' has non-Sendable type 'URLSession' (aka 'AnyObject')
42 |
43 | private let config: OpenAIConfiguration
44 | private let session: URLSession
| `- error: stored property 'session' of 'Sendable'-conforming struct 'OpenAILanguageModel' has non-Sendable type 'URLSession' (aka 'AnyObject')
45 |
46 | public init(config: OpenAIConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:89:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
87 | public struct AnthropicTokenCounter: Sendable {
88 | private let config: AnthropicConfiguration
89 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
90 |
91 | public init(config: AnthropicConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/TokenEstimator.swift:91:58: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
89 | private let session: URLSession
90 |
91 | public init(config: AnthropicConfiguration, session: URLSession = .shared) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
92 | self.config = config
93 | self.session = session
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/FoundationModelsKit/TokenEstimator.swift:91:72: error: value of type '_' expected to be instance of class or class-constrained type
89 | private let session: URLSession
90 |
91 | public init(config: AnthropicConfiguration, session: URLSession = .shared) {
| `- error: value of type '_' expected to be instance of class or class-constrained type
92 | self.config = config
93 | self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:91:72: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
89 | private let session: URLSession
90 |
91 | public init(config: AnthropicConfiguration, session: URLSession = .shared) {
| `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
92 | self.config = config
93 | self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:89:17: error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicTokenCounter' has non-Sendable type 'URLSession' (aka 'AnyObject')
87 | public struct AnthropicTokenCounter: Sendable {
88 | private let config: AnthropicConfiguration
89 | private let session: URLSession
| `- error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicTokenCounter' has non-Sendable type 'URLSession' (aka 'AnyObject')
90 |
91 | public init(config: AnthropicConfiguration, session: URLSession = .shared) {
[4/20] Compiling FoundationModelsKit TokenEstimator.swift
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:89:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
87 | public struct AnthropicTokenCounter: Sendable {
88 | private let config: AnthropicConfiguration
89 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
90 |
91 | public init(config: AnthropicConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/TokenEstimator.swift:91:58: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
89 | private let session: URLSession
90 |
91 | public init(config: AnthropicConfiguration, session: URLSession = .shared) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
92 | self.config = config
93 | self.session = session
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/FoundationModelsKit/TokenEstimator.swift:91:72: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
89 | private let session: URLSession
90 |
91 | public init(config: AnthropicConfiguration, session: URLSession = .shared) {
| `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
92 | self.config = config
93 | self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:91:72: error: value of type '_' expected to be instance of class or class-constrained type
89 | private let session: URLSession
90 |
91 | public init(config: AnthropicConfiguration, session: URLSession = .shared) {
| `- error: value of type '_' expected to be instance of class or class-constrained type
92 | self.config = config
93 | self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:89:17: error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicTokenCounter' has non-Sendable type 'URLSession' (aka 'AnyObject')
87 | public struct AnthropicTokenCounter: Sendable {
88 | private let config: AnthropicConfiguration
89 | private let session: URLSession
| `- error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicTokenCounter' has non-Sendable type 'URLSession' (aka 'AnyObject')
90 |
91 | public init(config: AnthropicConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:97:23: error: cannot find 'URLRequest' in scope
95 |
96 | public func exactTokenCount(of text: String) async throws -> Int {
97 | var request = URLRequest(url: config.baseURL.appendingPathComponent("v1/messages/count_tokens"))
| `- error: cannot find 'URLRequest' in scope
98 | request.httpMethod = "POST"
99 | request.setValue(config.apiKey, forHTTPHeaderField: "x-api-key")
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:107:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
105 | ])
106 |
107 | let (data, response) = try await session.data(for: request)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
108 | if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
109 | throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/Tool.swift:67:20: error: cannot find 'CFGetTypeID' in scope
65 | // Must precede any Bool case: NSNumber(1) bridges to Bool as true.
66 | case let v as NSNumber:
67 | self = CFGetTypeID(v) == CFBooleanGetTypeID() ? .bool(v.boolValue) : .number(v.doubleValue)
| `- error: cannot find 'CFGetTypeID' in scope
68 | case let v as String:
69 | self = .string(v)
/host/spi-builder-workspace/Sources/FoundationModelsKit/Tool.swift:67:38: error: cannot find 'CFBooleanGetTypeID' in scope
65 | // Must precede any Bool case: NSNumber(1) bridges to Bool as true.
66 | case let v as NSNumber:
67 | self = CFGetTypeID(v) == CFBooleanGetTypeID() ? .bool(v.boolValue) : .number(v.doubleValue)
| `- error: cannot find 'CFBooleanGetTypeID' in scope
68 | case let v as String:
69 | self = .string(v)
[5/20] Compiling FoundationModelsKit Tool.swift
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:89:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
87 | public struct AnthropicTokenCounter: Sendable {
88 | private let config: AnthropicConfiguration
89 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
90 |
91 | public init(config: AnthropicConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/TokenEstimator.swift:91:58: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
89 | private let session: URLSession
90 |
91 | public init(config: AnthropicConfiguration, session: URLSession = .shared) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
92 | self.config = config
93 | self.session = session
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/FoundationModelsKit/TokenEstimator.swift:91:72: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
89 | private let session: URLSession
90 |
91 | public init(config: AnthropicConfiguration, session: URLSession = .shared) {
| `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
92 | self.config = config
93 | self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:91:72: error: value of type '_' expected to be instance of class or class-constrained type
89 | private let session: URLSession
90 |
91 | public init(config: AnthropicConfiguration, session: URLSession = .shared) {
| `- error: value of type '_' expected to be instance of class or class-constrained type
92 | self.config = config
93 | self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:89:17: error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicTokenCounter' has non-Sendable type 'URLSession' (aka 'AnyObject')
87 | public struct AnthropicTokenCounter: Sendable {
88 | private let config: AnthropicConfiguration
89 | private let session: URLSession
| `- error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicTokenCounter' has non-Sendable type 'URLSession' (aka 'AnyObject')
90 |
91 | public init(config: AnthropicConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:97:23: error: cannot find 'URLRequest' in scope
95 |
96 | public func exactTokenCount(of text: String) async throws -> Int {
97 | var request = URLRequest(url: config.baseURL.appendingPathComponent("v1/messages/count_tokens"))
| `- error: cannot find 'URLRequest' in scope
98 | request.httpMethod = "POST"
99 | request.setValue(config.apiKey, forHTTPHeaderField: "x-api-key")
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:107:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
105 | ])
106 |
107 | let (data, response) = try await session.data(for: request)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
108 | if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
109 | throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/Tool.swift:67:20: error: cannot find 'CFGetTypeID' in scope
65 | // Must precede any Bool case: NSNumber(1) bridges to Bool as true.
66 | case let v as NSNumber:
67 | self = CFGetTypeID(v) == CFBooleanGetTypeID() ? .bool(v.boolValue) : .number(v.doubleValue)
| `- error: cannot find 'CFGetTypeID' in scope
68 | case let v as String:
69 | self = .string(v)
/host/spi-builder-workspace/Sources/FoundationModelsKit/Tool.swift:67:38: error: cannot find 'CFBooleanGetTypeID' in scope
65 | // Must precede any Bool case: NSNumber(1) bridges to Bool as true.
66 | case let v as NSNumber:
67 | self = CFGetTypeID(v) == CFBooleanGetTypeID() ? .bool(v.boolValue) : .number(v.doubleValue)
| `- error: cannot find 'CFBooleanGetTypeID' in scope
68 | case let v as String:
69 | self = .string(v)
[6/20] Compiling FoundationModelsKit MockLanguageModel.swift
[7/20] Compiling FoundationModelsKit ModelRouter.swift
[8/20] Compiling FoundationModelsKit OpenAILanguageModel.swift
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:44:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
42 |
43 | private let config: OpenAIConfiguration
44 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
45 |
46 | public init(config: OpenAIConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/OpenAILanguageModel.swift:46:55: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
44 | private let session: URLSession
45 |
46 | public init(config: OpenAIConfiguration, session: URLSession = .shared) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
47 | self.config = config
48 | self.session = session
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/FoundationModelsKit/OpenAILanguageModel.swift:46:69: error: value of type '_' expected to be instance of class or class-constrained type
44 | private let session: URLSession
45 |
46 | public init(config: OpenAIConfiguration, session: URLSession = .shared) {
| `- error: value of type '_' expected to be instance of class or class-constrained type
47 | self.config = config
48 | self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:46:69: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
44 | private let session: URLSession
45 |
46 | public init(config: OpenAIConfiguration, session: URLSession = .shared) {
| `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
47 | self.config = config
48 | self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:93:81: error: cannot find type 'URLRequest' in scope
91 | }
92 |
93 | private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
94 | var urlRequest = URLRequest(url: config.baseURL.appendingPathComponent("v1/chat/completions"))
95 | urlRequest.httpMethod = "POST"
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:110:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
108 | }
109 |
110 | private func validate(response: URLResponse, data: Data?) throws {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
111 | guard let http = response as? HTTPURLResponse else { return }
112 | guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/OpenAILanguageModel.swift:44:17: error: stored property 'session' of 'Sendable'-conforming struct 'OpenAILanguageModel' has non-Sendable type 'URLSession' (aka 'AnyObject')
42 |
43 | private let config: OpenAIConfiguration
44 | private let session: URLSession
| `- error: stored property 'session' of 'Sendable'-conforming struct 'OpenAILanguageModel' has non-Sendable type 'URLSession' (aka 'AnyObject')
45 |
46 | public init(config: OpenAIConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:53:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
51 | public func respond(to request: ModelRequest) async throws -> ModelResponse {
52 | let urlRequest = try makeRequest(for: request, stream: false)
53 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
54 | try validate(response: response, data: data)
55 | return try decode(data: data)
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:94:26: error: cannot find 'URLRequest' in scope
92 |
93 | private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
94 | var urlRequest = URLRequest(url: config.baseURL.appendingPathComponent("v1/chat/completions"))
| `- error: cannot find 'URLRequest' in scope
95 | urlRequest.httpMethod = "POST"
96 | urlRequest.setValue("Bearer \(config.apiKey)", forHTTPHeaderField: "Authorization")
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:111:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
109 |
110 | private func validate(response: URLResponse, data: Data?) throws {
111 | guard let http = response as? HTTPURLResponse else { return }
| `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
112 | guard (200..<300).contains(http.statusCode) else {
113 | if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:111:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
109 |
110 | private func validate(response: URLResponse, data: Data?) throws {
111 | guard let http = response as? HTTPURLResponse else { return }
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
112 | guard (200..<300).contains(http.statusCode) else {
113 | if Self.isTransient(statusCode: http.statusCode) {
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/FoundationModelsKit/OpenAILanguageModel.swift:112:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
110 | private func validate(response: URLResponse, data: Data?) throws {
111 | guard let http = response as? HTTPURLResponse else { return }
112 | guard (200..<300).contains(http.statusCode) else {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
113 | if Self.isTransient(statusCode: http.statusCode) {
114 | throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:113:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
111 | guard let http = response as? HTTPURLResponse else { return }
112 | guard (200..<300).contains(http.statusCode) else {
113 | if Self.isTransient(statusCode: http.statusCode) {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
114 | throw LanguageModelError.unavailable
115 | }
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:117:57: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
115 | }
116 | let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
117 | throw OpenAIError.apiError(statusCode: http.statusCode, body: detail)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
118 | }
119 | }
[9/20] Compiling FoundationModelsKit RegionalAvailability.swift
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:44:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
42 |
43 | private let config: OpenAIConfiguration
44 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
45 |
46 | public init(config: OpenAIConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/OpenAILanguageModel.swift:46:55: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
44 | private let session: URLSession
45 |
46 | public init(config: OpenAIConfiguration, session: URLSession = .shared) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
47 | self.config = config
48 | self.session = session
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/FoundationModelsKit/OpenAILanguageModel.swift:46:69: error: value of type '_' expected to be instance of class or class-constrained type
44 | private let session: URLSession
45 |
46 | public init(config: OpenAIConfiguration, session: URLSession = .shared) {
| `- error: value of type '_' expected to be instance of class or class-constrained type
47 | self.config = config
48 | self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:46:69: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
44 | private let session: URLSession
45 |
46 | public init(config: OpenAIConfiguration, session: URLSession = .shared) {
| `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
47 | self.config = config
48 | self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:93:81: error: cannot find type 'URLRequest' in scope
91 | }
92 |
93 | private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
94 | var urlRequest = URLRequest(url: config.baseURL.appendingPathComponent("v1/chat/completions"))
95 | urlRequest.httpMethod = "POST"
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:110:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
108 | }
109 |
110 | private func validate(response: URLResponse, data: Data?) throws {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
111 | guard let http = response as? HTTPURLResponse else { return }
112 | guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/OpenAILanguageModel.swift:44:17: error: stored property 'session' of 'Sendable'-conforming struct 'OpenAILanguageModel' has non-Sendable type 'URLSession' (aka 'AnyObject')
42 |
43 | private let config: OpenAIConfiguration
44 | private let session: URLSession
| `- error: stored property 'session' of 'Sendable'-conforming struct 'OpenAILanguageModel' has non-Sendable type 'URLSession' (aka 'AnyObject')
45 |
46 | public init(config: OpenAIConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:53:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
51 | public func respond(to request: ModelRequest) async throws -> ModelResponse {
52 | let urlRequest = try makeRequest(for: request, stream: false)
53 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
54 | try validate(response: response, data: data)
55 | return try decode(data: data)
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:94:26: error: cannot find 'URLRequest' in scope
92 |
93 | private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
94 | var urlRequest = URLRequest(url: config.baseURL.appendingPathComponent("v1/chat/completions"))
| `- error: cannot find 'URLRequest' in scope
95 | urlRequest.httpMethod = "POST"
96 | urlRequest.setValue("Bearer \(config.apiKey)", forHTTPHeaderField: "Authorization")
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:111:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
109 |
110 | private func validate(response: URLResponse, data: Data?) throws {
111 | guard let http = response as? HTTPURLResponse else { return }
| `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
112 | guard (200..<300).contains(http.statusCode) else {
113 | if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:111:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
109 |
110 | private func validate(response: URLResponse, data: Data?) throws {
111 | guard let http = response as? HTTPURLResponse else { return }
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
112 | guard (200..<300).contains(http.statusCode) else {
113 | if Self.isTransient(statusCode: http.statusCode) {
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/FoundationModelsKit/OpenAILanguageModel.swift:112:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
110 | private func validate(response: URLResponse, data: Data?) throws {
111 | guard let http = response as? HTTPURLResponse else { return }
112 | guard (200..<300).contains(http.statusCode) else {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
113 | if Self.isTransient(statusCode: http.statusCode) {
114 | throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:113:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
111 | guard let http = response as? HTTPURLResponse else { return }
112 | guard (200..<300).contains(http.statusCode) else {
113 | if Self.isTransient(statusCode: http.statusCode) {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
114 | throw LanguageModelError.unavailable
115 | }
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:117:57: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
115 | }
116 | let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
117 | throw OpenAIError.apiError(statusCode: http.statusCode, body: detail)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
118 | }
119 | }
[10/20] Compiling FoundationModelsKit RetryPolicy.swift
[11/20] Compiling FoundationModelsKit SDKIntegration.swift
[12/20] Compiling FoundationModelsKit OnDeviceLanguageModel.swift
[13/20] Compiling FoundationModelsKit OnDeviceToolBridge.swift
[14/20] Compiling FoundationModelsKit HTTPBackendSupport.swift
[15/20] Compiling FoundationModelsKit LanguageModelProviding.swift
[16/20] Compiling FoundationModelsKit EvaluationSuite.swift
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:44:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
42 |
43 | private let config: GeminiConfiguration
44 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
45 |
46 | public init(config: GeminiConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/GeminiLanguageModel.swift:46:55: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
44 | private let session: URLSession
45 |
46 | public init(config: GeminiConfiguration, session: URLSession = .shared) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
47 | self.config = config
48 | self.session = session
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/FoundationModelsKit/GeminiLanguageModel.swift:46:69: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
44 | private let session: URLSession
45 |
46 | public init(config: GeminiConfiguration, session: URLSession = .shared) {
| `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
47 | self.config = config
48 | self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:46:69: error: value of type '_' expected to be instance of class or class-constrained type
44 | private let session: URLSession
45 |
46 | public init(config: GeminiConfiguration, session: URLSession = .shared) {
| `- error: value of type '_' expected to be instance of class or class-constrained type
47 | self.config = config
48 | self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:93:81: error: cannot find type 'URLRequest' in scope
91 | }
92 |
93 | private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
94 | let method = stream ? "streamGenerateContent" : "generateContent"
95 | var components = URLComponents(
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:117:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
115 | }
116 |
117 | private func validate(response: URLResponse, data: Data?) throws {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
118 | guard let http = response as? HTTPURLResponse else { return }
119 | guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/GeminiLanguageModel.swift:44:17: error: stored property 'session' of 'Sendable'-conforming struct 'GeminiLanguageModel' has non-Sendable type 'URLSession' (aka 'AnyObject')
42 |
43 | private let config: GeminiConfiguration
44 | private let session: URLSession
| `- error: stored property 'session' of 'Sendable'-conforming struct 'GeminiLanguageModel' has non-Sendable type 'URLSession' (aka 'AnyObject')
45 |
46 | public init(config: GeminiConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:53:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
51 | public func respond(to request: ModelRequest) async throws -> ModelResponse {
52 | let urlRequest = try makeRequest(for: request, stream: false)
53 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
54 | try validate(response: response, data: data)
55 | return try decode(data: data)
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:107:26: error: cannot find 'URLRequest' in scope
105 | }
106 |
107 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
108 | urlRequest.httpMethod = "POST"
109 | urlRequest.setValue("application/json", forHTTPHeaderField: "content-type")
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:118:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
116 |
117 | private func validate(response: URLResponse, data: Data?) throws {
118 | guard let http = response as? HTTPURLResponse else { return }
| `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
119 | guard (200..<300).contains(http.statusCode) else {
120 | if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:118:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
116 |
117 | private func validate(response: URLResponse, data: Data?) throws {
118 | guard let http = response as? HTTPURLResponse else { return }
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
119 | guard (200..<300).contains(http.statusCode) else {
120 | if Self.isTransient(statusCode: http.statusCode) {
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/FoundationModelsKit/GeminiLanguageModel.swift:119:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
117 | private func validate(response: URLResponse, data: Data?) throws {
118 | guard let http = response as? HTTPURLResponse else { return }
119 | guard (200..<300).contains(http.statusCode) else {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
120 | if Self.isTransient(statusCode: http.statusCode) {
121 | throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:120:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
118 | guard let http = response as? HTTPURLResponse else { return }
119 | guard (200..<300).contains(http.statusCode) else {
120 | if Self.isTransient(statusCode: http.statusCode) {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
121 | throw LanguageModelError.unavailable
122 | }
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:124:57: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
122 | }
123 | let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
124 | throw GeminiError.apiError(statusCode: http.statusCode, body: detail)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
125 | }
126 | }
[17/20] Compiling FoundationModelsKit GeminiLanguageModel.swift
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:44:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
42 |
43 | private let config: GeminiConfiguration
44 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
45 |
46 | public init(config: GeminiConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/GeminiLanguageModel.swift:46:55: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
44 | private let session: URLSession
45 |
46 | public init(config: GeminiConfiguration, session: URLSession = .shared) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
47 | self.config = config
48 | self.session = session
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/FoundationModelsKit/GeminiLanguageModel.swift:46:69: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
44 | private let session: URLSession
45 |
46 | public init(config: GeminiConfiguration, session: URLSession = .shared) {
| `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
47 | self.config = config
48 | self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:46:69: error: value of type '_' expected to be instance of class or class-constrained type
44 | private let session: URLSession
45 |
46 | public init(config: GeminiConfiguration, session: URLSession = .shared) {
| `- error: value of type '_' expected to be instance of class or class-constrained type
47 | self.config = config
48 | self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:93:81: error: cannot find type 'URLRequest' in scope
91 | }
92 |
93 | private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
94 | let method = stream ? "streamGenerateContent" : "generateContent"
95 | var components = URLComponents(
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:117:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
115 | }
116 |
117 | private func validate(response: URLResponse, data: Data?) throws {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
118 | guard let http = response as? HTTPURLResponse else { return }
119 | guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/GeminiLanguageModel.swift:44:17: error: stored property 'session' of 'Sendable'-conforming struct 'GeminiLanguageModel' has non-Sendable type 'URLSession' (aka 'AnyObject')
42 |
43 | private let config: GeminiConfiguration
44 | private let session: URLSession
| `- error: stored property 'session' of 'Sendable'-conforming struct 'GeminiLanguageModel' has non-Sendable type 'URLSession' (aka 'AnyObject')
45 |
46 | public init(config: GeminiConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:53:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
51 | public func respond(to request: ModelRequest) async throws -> ModelResponse {
52 | let urlRequest = try makeRequest(for: request, stream: false)
53 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
54 | try validate(response: response, data: data)
55 | return try decode(data: data)
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:107:26: error: cannot find 'URLRequest' in scope
105 | }
106 |
107 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
108 | urlRequest.httpMethod = "POST"
109 | urlRequest.setValue("application/json", forHTTPHeaderField: "content-type")
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:118:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
116 |
117 | private func validate(response: URLResponse, data: Data?) throws {
118 | guard let http = response as? HTTPURLResponse else { return }
| `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
119 | guard (200..<300).contains(http.statusCode) else {
120 | if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:118:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
116 |
117 | private func validate(response: URLResponse, data: Data?) throws {
118 | guard let http = response as? HTTPURLResponse else { return }
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
119 | guard (200..<300).contains(http.statusCode) else {
120 | if Self.isTransient(statusCode: http.statusCode) {
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/FoundationModelsKit/GeminiLanguageModel.swift:119:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
117 | private func validate(response: URLResponse, data: Data?) throws {
118 | guard let http = response as? HTTPURLResponse else { return }
119 | guard (200..<300).contains(http.statusCode) else {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
120 | if Self.isTransient(statusCode: http.statusCode) {
121 | throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:120:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
118 | guard let http = response as? HTTPURLResponse else { return }
119 | guard (200..<300).contains(http.statusCode) else {
120 | if Self.isTransient(statusCode: http.statusCode) {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
121 | throw LanguageModelError.unavailable
122 | }
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:124:57: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
122 | }
123 | let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
124 | throw GeminiError.apiError(statusCode: http.statusCode, body: detail)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
125 | }
126 | }
[18/20] Compiling FoundationModelsKit AnthropicLanguageModel.swift
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:70:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
68 |
69 | private let config: AnthropicConfiguration
70 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
71 | private let tools: ToolRegistry
72 |
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/FoundationModelsKit/AnthropicLanguageModel.swift:80:18: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
78 | config: AnthropicConfiguration,
79 | tools: [any ModelTool] = [],
80 | session: URLSession = .shared
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
81 | ) {
82 | self.config = config
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/FoundationModelsKit/AnthropicLanguageModel.swift:80:32: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
78 | config: AnthropicConfiguration,
79 | tools: [any ModelTool] = [],
80 | session: URLSession = .shared
| `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
81 | ) {
82 | self.config = config
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:80:32: error: value of type '_' expected to be instance of class or class-constrained type
78 | config: AnthropicConfiguration,
79 | tools: [any ModelTool] = [],
80 | session: URLSession = .shared
| `- error: value of type '_' expected to be instance of class or class-constrained type
81 | ) {
82 | self.config = config
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:165:81: error: cannot find type 'URLRequest' in scope
163 | // MARK: - Private helpers
164 |
165 | private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
166 | try makeRequest(messages: [["role": "user", "content": request.content]], stream: stream)
167 | }
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:169:81: error: cannot find type 'URLRequest' in scope
167 | }
168 |
169 | private func makeRequest(messages: [[String: Any]], stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
170 | let url = config.baseURL.appendingPathComponent("v1/messages")
171 | var urlRequest = URLRequest(url: url)
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:202:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
200 | }
201 |
202 | private func validate(response: URLResponse, data: Data?) throws {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
203 | guard let http = response as? HTTPURLResponse else { return }
204 | guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/AnthropicLanguageModel.swift:70:17: error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicLanguageModel' has non-Sendable type 'URLSession' (aka 'AnyObject')
68 |
69 | private let config: AnthropicConfiguration
70 | private let session: URLSession
| `- error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicLanguageModel' has non-Sendable type 'URLSession' (aka 'AnyObject')
71 | private let tools: ToolRegistry
72 |
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:95:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
93 | for _ in 0..<Self.maxToolTurns {
94 | let urlRequest = try makeRequest(messages: messages, stream: false)
95 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
96 | try validate(response: response, data: data)
97 |
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:171:26: error: cannot find 'URLRequest' in scope
169 | private func makeRequest(messages: [[String: Any]], stream: Bool) throws -> URLRequest {
170 | let url = config.baseURL.appendingPathComponent("v1/messages")
171 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
172 | urlRequest.httpMethod = "POST"
173 | urlRequest.setValue(config.apiKey, forHTTPHeaderField: "x-api-key")
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:203:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
201 |
202 | private func validate(response: URLResponse, data: Data?) throws {
203 | guard let http = response as? HTTPURLResponse else { return }
| `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
204 | guard (200..<300).contains(http.statusCode) else {
205 | if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:203:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
201 |
202 | private func validate(response: URLResponse, data: Data?) throws {
203 | guard let http = response as? HTTPURLResponse else { return }
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
204 | guard (200..<300).contains(http.statusCode) else {
205 | if Self.isTransient(statusCode: http.statusCode) {
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/FoundationModelsKit/AnthropicLanguageModel.swift:204:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
202 | private func validate(response: URLResponse, data: Data?) throws {
203 | guard let http = response as? HTTPURLResponse else { return }
204 | guard (200..<300).contains(http.statusCode) else {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
205 | if Self.isTransient(statusCode: http.statusCode) {
206 | throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:205:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
203 | guard let http = response as? HTTPURLResponse else { return }
204 | guard (200..<300).contains(http.statusCode) else {
205 | if Self.isTransient(statusCode: http.statusCode) {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
206 | throw LanguageModelError.unavailable
207 | }
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:210:60: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
208 | // Client error: retrying would resend the same bad request.
209 | let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
210 | throw AnthropicError.apiError(statusCode: http.statusCode, body: detail)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
211 | }
212 | }
[19/20] Compiling FoundationModelsKit ConversationStore.swift
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:70:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
68 |
69 | private let config: AnthropicConfiguration
70 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
71 | private let tools: ToolRegistry
72 |
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/FoundationModelsKit/AnthropicLanguageModel.swift:80:18: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
78 | config: AnthropicConfiguration,
79 | tools: [any ModelTool] = [],
80 | session: URLSession = .shared
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
81 | ) {
82 | self.config = config
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/FoundationModelsKit/AnthropicLanguageModel.swift:80:32: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
78 | config: AnthropicConfiguration,
79 | tools: [any ModelTool] = [],
80 | session: URLSession = .shared
| `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
81 | ) {
82 | self.config = config
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:80:32: error: value of type '_' expected to be instance of class or class-constrained type
78 | config: AnthropicConfiguration,
79 | tools: [any ModelTool] = [],
80 | session: URLSession = .shared
| `- error: value of type '_' expected to be instance of class or class-constrained type
81 | ) {
82 | self.config = config
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:165:81: error: cannot find type 'URLRequest' in scope
163 | // MARK: - Private helpers
164 |
165 | private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
166 | try makeRequest(messages: [["role": "user", "content": request.content]], stream: stream)
167 | }
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:169:81: error: cannot find type 'URLRequest' in scope
167 | }
168 |
169 | private func makeRequest(messages: [[String: Any]], stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
170 | let url = config.baseURL.appendingPathComponent("v1/messages")
171 | var urlRequest = URLRequest(url: url)
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:202:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
200 | }
201 |
202 | private func validate(response: URLResponse, data: Data?) throws {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
203 | guard let http = response as? HTTPURLResponse else { return }
204 | guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/AnthropicLanguageModel.swift:70:17: error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicLanguageModel' has non-Sendable type 'URLSession' (aka 'AnyObject')
68 |
69 | private let config: AnthropicConfiguration
70 | private let session: URLSession
| `- error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicLanguageModel' has non-Sendable type 'URLSession' (aka 'AnyObject')
71 | private let tools: ToolRegistry
72 |
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:95:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
93 | for _ in 0..<Self.maxToolTurns {
94 | let urlRequest = try makeRequest(messages: messages, stream: false)
95 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
96 | try validate(response: response, data: data)
97 |
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:171:26: error: cannot find 'URLRequest' in scope
169 | private func makeRequest(messages: [[String: Any]], stream: Bool) throws -> URLRequest {
170 | let url = config.baseURL.appendingPathComponent("v1/messages")
171 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
172 | urlRequest.httpMethod = "POST"
173 | urlRequest.setValue(config.apiKey, forHTTPHeaderField: "x-api-key")
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:203:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
201 |
202 | private func validate(response: URLResponse, data: Data?) throws {
203 | guard let http = response as? HTTPURLResponse else { return }
| `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
204 | guard (200..<300).contains(http.statusCode) else {
205 | if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:203:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
201 |
202 | private func validate(response: URLResponse, data: Data?) throws {
203 | guard let http = response as? HTTPURLResponse else { return }
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
204 | guard (200..<300).contains(http.statusCode) else {
205 | if Self.isTransient(statusCode: http.statusCode) {
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/FoundationModelsKit/AnthropicLanguageModel.swift:204:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
202 | private func validate(response: URLResponse, data: Data?) throws {
203 | guard let http = response as? HTTPURLResponse else { return }
204 | guard (200..<300).contains(http.statusCode) else {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
205 | if Self.isTransient(statusCode: http.statusCode) {
206 | throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:205:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
203 | guard let http = response as? HTTPURLResponse else { return }
204 | guard (200..<300).contains(http.statusCode) else {
205 | if Self.isTransient(statusCode: http.statusCode) {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
206 | throw LanguageModelError.unavailable
207 | }
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:210:60: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
208 | // Client error: retrying would resend the same bad request.
209 | let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
210 | throw AnthropicError.apiError(statusCode: http.statusCode, body: detail)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
211 | }
212 | }
[20/20] Compiling FoundationModelsKit DynamicProfileBuilder.swift
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:70:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
68 |
69 | private let config: AnthropicConfiguration
70 | private let session: URLSession
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
71 | private let tools: ToolRegistry
72 |
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/FoundationModelsKit/AnthropicLanguageModel.swift:80:18: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
78 | config: AnthropicConfiguration,
79 | tools: [any ModelTool] = [],
80 | session: URLSession = .shared
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
81 | ) {
82 | self.config = config
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/FoundationModelsKit/AnthropicLanguageModel.swift:80:32: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
78 | config: AnthropicConfiguration,
79 | tools: [any ModelTool] = [],
80 | session: URLSession = .shared
| `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
81 | ) {
82 | self.config = config
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:80:32: error: value of type '_' expected to be instance of class or class-constrained type
78 | config: AnthropicConfiguration,
79 | tools: [any ModelTool] = [],
80 | session: URLSession = .shared
| `- error: value of type '_' expected to be instance of class or class-constrained type
81 | ) {
82 | self.config = config
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:165:81: error: cannot find type 'URLRequest' in scope
163 | // MARK: - Private helpers
164 |
165 | private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
166 | try makeRequest(messages: [["role": "user", "content": request.content]], stream: stream)
167 | }
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:169:81: error: cannot find type 'URLRequest' in scope
167 | }
168 |
169 | private func makeRequest(messages: [[String: Any]], stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
170 | let url = config.baseURL.appendingPathComponent("v1/messages")
171 | var urlRequest = URLRequest(url: url)
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:202:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
200 | }
201 |
202 | private func validate(response: URLResponse, data: Data?) throws {
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
203 | guard let http = response as? HTTPURLResponse else { return }
204 | guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/AnthropicLanguageModel.swift:70:17: error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicLanguageModel' has non-Sendable type 'URLSession' (aka 'AnyObject')
68 |
69 | private let config: AnthropicConfiguration
70 | private let session: URLSession
| `- error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicLanguageModel' has non-Sendable type 'URLSession' (aka 'AnyObject')
71 | private let tools: ToolRegistry
72 |
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:95:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
93 | for _ in 0..<Self.maxToolTurns {
94 | let urlRequest = try makeRequest(messages: messages, stream: false)
95 | let (data, response) = try await session.data(for: urlRequest)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
96 | try validate(response: response, data: data)
97 |
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:171:26: error: cannot find 'URLRequest' in scope
169 | private func makeRequest(messages: [[String: Any]], stream: Bool) throws -> URLRequest {
170 | let url = config.baseURL.appendingPathComponent("v1/messages")
171 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
172 | urlRequest.httpMethod = "POST"
173 | urlRequest.setValue(config.apiKey, forHTTPHeaderField: "x-api-key")
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:203:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
201 |
202 | private func validate(response: URLResponse, data: Data?) throws {
203 | guard let http = response as? HTTPURLResponse else { return }
| `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
204 | guard (200..<300).contains(http.statusCode) else {
205 | if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:203:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
201 |
202 | private func validate(response: URLResponse, data: Data?) throws {
203 | guard let http = response as? HTTPURLResponse else { return }
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
204 | guard (200..<300).contains(http.statusCode) else {
205 | if Self.isTransient(statusCode: http.statusCode) {
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/FoundationModelsKit/AnthropicLanguageModel.swift:204:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
202 | private func validate(response: URLResponse, data: Data?) throws {
203 | guard let http = response as? HTTPURLResponse else { return }
204 | guard (200..<300).contains(http.statusCode) else {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
205 | if Self.isTransient(statusCode: http.statusCode) {
206 | throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:205:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
203 | guard let http = response as? HTTPURLResponse else { return }
204 | guard (200..<300).contains(http.statusCode) else {
205 | if Self.isTransient(statusCode: http.statusCode) {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
206 | throw LanguageModelError.unavailable
207 | }
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:210:60: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
208 | // Client error: retrying would resend the same bad request.
209 | let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
210 | throw AnthropicError.apiError(statusCode: http.statusCode, body: detail)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
211 | }
212 | }
BUILD FAILURE 6.2 linux