Build Information
Failed to build FoundationModelsKit, reference main (691a96), with Swift 6.2 for Linux on 12 Oct 2026 08:51:38 UTC.
Build Command
bash -c docker run --pull=always --rm -v "checkouts-54344849-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:basic-6.2-latest swift build --triple x86_64-unknown-linux-gnu 2>&1Build Log
========================================
RunAll
========================================
Builder version: 5.1.1
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 691a965 Rename sendMessage/streamMessage to respond(to:)/streamResponse(to:)
Cloned https://github.com/divyaravitech/FoundationModelsKit.git
Revision (git rev-parse @):
691a965deafc558fde738f2175766ac7eaea62f9
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-54344849-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:basic-6.2-latest swift build --triple x86_64-unknown-linux-gnu 2>&1
basic-6.2-latest: Pulling from saguaro1/spi-images
Digest: sha256:24009fa1488c01937630ee3297a7a7a1872c773069724929dff85071fefc3743
Status: Image is up to date for registry.gitlab.com/saguaro1/spi-images:basic-6.2-latest
Building for debugging...
[0/2] Write sources
[1/2] Write swift-version-24593BA9C3E375BF.txt
[3/17] 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 | }
[4/17] 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 | }
[5/19] Compiling FoundationModelsKit RetryPolicy.swift
[6/19] Compiling FoundationModelsKit SDKIntegration.swift
error: emit-module command failed with exit code 1 (use -v to see invocation)
[7/19] Compiling FoundationModelsKit DynamicProfileBuilder.swift
[8/19] Compiling FoundationModelsKit EvaluationSuite.swift
[9/19] 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: 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:166:81: error: cannot find type 'URLRequest' in scope
164 | // MARK: - Private helpers
165 |
166 | private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
167 | try makeRequest(messages: [["role": "user", "content": request.content]], stream: stream)
168 | }
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:170:81: error: cannot find type 'URLRequest' in scope
168 | }
169 |
170 | private func makeRequest(messages: [[String: Any]], stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
171 | let url = config.baseURL.appendingPathComponent("v1/messages")
172 | var urlRequest = URLRequest(url: url)
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:212:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
210 | }
211 |
212 | 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.
213 | guard let http = response as? HTTPURLResponse else { return }
214 | 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:92:81: error: cannot find type 'URLRequest' in scope
90 | }
91 |
92 | private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
93 | let method = stream ? "streamGenerateContent" : "generateContent"
94 | var components = URLComponents(
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:116:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
114 | }
115 |
116 | 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.
117 | guard let http = response as? HTTPURLResponse else { return }
118 | 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: 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) {
[10/19] 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)
[11/19] 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)
[12/19] Compiling FoundationModelsKit MockLanguageModel.swift
[13/19] Compiling FoundationModelsKit ModelRouter.swift
[14/19] Compiling FoundationModelsKit OnDeviceLanguageModel.swift
[15/19] Compiling FoundationModelsKit OnDeviceToolBridge.swift
[16/19] 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:166:81: error: cannot find type 'URLRequest' in scope
164 | // MARK: - Private helpers
165 |
166 | private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
167 | try makeRequest(messages: [["role": "user", "content": request.content]], stream: stream)
168 | }
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:170:81: error: cannot find type 'URLRequest' in scope
168 | }
169 |
170 | private func makeRequest(messages: [[String: Any]], stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
171 | let url = config.baseURL.appendingPathComponent("v1/messages")
172 | var urlRequest = URLRequest(url: url)
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:212:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
210 | }
211 |
212 | 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.
213 | guard let http = response as? HTTPURLResponse else { return }
214 | 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:172:26: error: cannot find 'URLRequest' in scope
170 | private func makeRequest(messages: [[String: Any]], stream: Bool) throws -> URLRequest {
171 | let url = config.baseURL.appendingPathComponent("v1/messages")
172 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
173 | urlRequest.httpMethod = "POST"
174 | urlRequest.setValue(config.apiKey, forHTTPHeaderField: "x-api-key")
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:213:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
211 |
212 | private func validate(response: URLResponse, data: Data?) throws {
213 | guard let http = response as? HTTPURLResponse else { return }
| `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
214 | guard (200..<300).contains(http.statusCode) else {
215 | if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:213:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
211 |
212 | private func validate(response: URLResponse, data: Data?) throws {
213 | 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.
214 | guard (200..<300).contains(http.statusCode) else {
215 | 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:214:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
212 | private func validate(response: URLResponse, data: Data?) throws {
213 | guard let http = response as? HTTPURLResponse else { return }
214 | guard (200..<300).contains(http.statusCode) else {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
215 | if Self.isTransient(statusCode: http.statusCode) {
216 | throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:215:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
213 | guard let http = response as? HTTPURLResponse else { return }
214 | guard (200..<300).contains(http.statusCode) else {
215 | if Self.isTransient(statusCode: http.statusCode) {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
216 | throw LanguageModelError.unavailable
217 | }
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:220:60: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
218 | // Client error: retrying would resend the same bad request.
219 | let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
220 | throw AnthropicError.apiError(statusCode: http.statusCode, body: detail)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
221 | }
222 | }
[17/19] 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:166:81: error: cannot find type 'URLRequest' in scope
164 | // MARK: - Private helpers
165 |
166 | private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
167 | try makeRequest(messages: [["role": "user", "content": request.content]], stream: stream)
168 | }
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:170:81: error: cannot find type 'URLRequest' in scope
168 | }
169 |
170 | private func makeRequest(messages: [[String: Any]], stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
171 | let url = config.baseURL.appendingPathComponent("v1/messages")
172 | var urlRequest = URLRequest(url: url)
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:212:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
210 | }
211 |
212 | 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.
213 | guard let http = response as? HTTPURLResponse else { return }
214 | 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:172:26: error: cannot find 'URLRequest' in scope
170 | private func makeRequest(messages: [[String: Any]], stream: Bool) throws -> URLRequest {
171 | let url = config.baseURL.appendingPathComponent("v1/messages")
172 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
173 | urlRequest.httpMethod = "POST"
174 | urlRequest.setValue(config.apiKey, forHTTPHeaderField: "x-api-key")
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:213:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
211 |
212 | private func validate(response: URLResponse, data: Data?) throws {
213 | guard let http = response as? HTTPURLResponse else { return }
| `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
214 | guard (200..<300).contains(http.statusCode) else {
215 | if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:213:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
211 |
212 | private func validate(response: URLResponse, data: Data?) throws {
213 | 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.
214 | guard (200..<300).contains(http.statusCode) else {
215 | 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:214:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
212 | private func validate(response: URLResponse, data: Data?) throws {
213 | guard let http = response as? HTTPURLResponse else { return }
214 | guard (200..<300).contains(http.statusCode) else {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
215 | if Self.isTransient(statusCode: http.statusCode) {
216 | throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:215:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
213 | guard let http = response as? HTTPURLResponse else { return }
214 | guard (200..<300).contains(http.statusCode) else {
215 | if Self.isTransient(statusCode: http.statusCode) {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
216 | throw LanguageModelError.unavailable
217 | }
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:220:60: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
218 | // Client error: retrying would resend the same bad request.
219 | let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
220 | throw AnthropicError.apiError(statusCode: http.statusCode, body: detail)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
221 | }
222 | }
[18/19] 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: 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:92:81: error: cannot find type 'URLRequest' in scope
90 | }
91 |
92 | private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
93 | let method = stream ? "streamGenerateContent" : "generateContent"
94 | var components = URLComponents(
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:116:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
114 | }
115 |
116 | 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.
117 | guard let http = response as? HTTPURLResponse else { return }
118 | 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:106:26: error: cannot find 'URLRequest' in scope
104 | }
105 |
106 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
107 | urlRequest.httpMethod = "POST"
108 | urlRequest.setValue("application/json", forHTTPHeaderField: "content-type")
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:117:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
115 |
116 | private func validate(response: URLResponse, data: Data?) throws {
117 | guard let http = response as? HTTPURLResponse else { return }
| `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
118 | guard (200..<300).contains(http.statusCode) else {
119 | if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:117:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
115 |
116 | private func validate(response: URLResponse, data: Data?) throws {
117 | 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.
118 | guard (200..<300).contains(http.statusCode) else {
119 | 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:118:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
116 | private func validate(response: URLResponse, data: Data?) throws {
117 | guard let http = response as? HTTPURLResponse else { return }
118 | guard (200..<300).contains(http.statusCode) else {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
119 | if Self.isTransient(statusCode: http.statusCode) {
120 | throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:119:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
117 | guard let http = response as? HTTPURLResponse else { return }
118 | guard (200..<300).contains(http.statusCode) else {
119 | if Self.isTransient(statusCode: http.statusCode) {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
120 | throw LanguageModelError.unavailable
121 | }
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:123:57: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
121 | }
122 | let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
123 | throw GeminiError.apiError(statusCode: http.statusCode, body: detail)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
124 | }
125 | }
[19/19] Compiling FoundationModelsKit LanguageModelProviding.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: 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:92:81: error: cannot find type 'URLRequest' in scope
90 | }
91 |
92 | private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
93 | let method = stream ? "streamGenerateContent" : "generateContent"
94 | var components = URLComponents(
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:116:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
114 | }
115 |
116 | 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.
117 | guard let http = response as? HTTPURLResponse else { return }
118 | 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:106:26: error: cannot find 'URLRequest' in scope
104 | }
105 |
106 | var urlRequest = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
107 | urlRequest.httpMethod = "POST"
108 | urlRequest.setValue("application/json", forHTTPHeaderField: "content-type")
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:117:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
115 |
116 | private func validate(response: URLResponse, data: Data?) throws {
117 | guard let http = response as? HTTPURLResponse else { return }
| `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
118 | guard (200..<300).contains(http.statusCode) else {
119 | if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:117:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
115 |
116 | private func validate(response: URLResponse, data: Data?) throws {
117 | 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.
118 | guard (200..<300).contains(http.statusCode) else {
119 | 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:118:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
116 | private func validate(response: URLResponse, data: Data?) throws {
117 | guard let http = response as? HTTPURLResponse else { return }
118 | guard (200..<300).contains(http.statusCode) else {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
119 | if Self.isTransient(statusCode: http.statusCode) {
120 | throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:119:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
117 | guard let http = response as? HTTPURLResponse else { return }
118 | guard (200..<300).contains(http.statusCode) else {
119 | if Self.isTransient(statusCode: http.statusCode) {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
120 | throw LanguageModelError.unavailable
121 | }
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:123:57: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
121 | }
122 | let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
123 | throw GeminiError.apiError(statusCode: http.statusCode, body: detail)
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
124 | }
125 | }
BUILD FAILURE 6.2 linux