Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions FirebaseAI/Sources/ModelContent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,18 @@ public struct ModelContent: Equatable, Sendable {
isThought: functionResponsePart._isThought,
thoughtSignature: functionResponsePart.thoughtSignature
))
case let executableCodePart as ExecutableCodePart:
convertedParts.append(InternalPart(
.executableCode(executableCodePart.executableCode),
isThought: executableCodePart._isThought,
thoughtSignature: executableCodePart.thoughtSignature
))
case let codeExecutionResultPart as CodeExecutionResultPart:
convertedParts.append(InternalPart(
.codeExecutionResult(codeExecutionResultPart.codeExecutionResult),
isThought: codeExecutionResultPart._isThought,
thoughtSignature: codeExecutionResultPart.thoughtSignature
))
default:
fatalError()
}
Expand Down
115 changes: 115 additions & 0 deletions FirebaseAI/Tests/Unit/ModelContentTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import Foundation
import XCTest

@testable import FirebaseAILogic

@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
final class ModelContentTests: XCTestCase {
// MARK: - ModelContent Initialization with Part Types

func testInitWithExecutableCodePart() {
let executableCodePart = ExecutableCodePart(language: .python, code: "print('hello')")

let content = ModelContent(role: "model", parts: [executableCodePart])

XCTAssertEqual(content.role, "model")
XCTAssertEqual(content.parts.count, 1)
guard let resultPart = content.parts.first as? ExecutableCodePart else {
XCTFail("Expected ExecutableCodePart")
return
}
XCTAssertEqual(resultPart.language, .python)
XCTAssertEqual(resultPart.code, "print('hello')")
}

func testInitWithCodeExecutionResultPart() {
let codeExecutionResultPart = CodeExecutionResultPart(outcome: .ok, output: "hello")

let content = ModelContent(role: "model", parts: [codeExecutionResultPart])

XCTAssertEqual(content.role, "model")
XCTAssertEqual(content.parts.count, 1)
guard let resultPart = content.parts.first as? CodeExecutionResultPart else {
XCTFail("Expected CodeExecutionResultPart")
return
}
XCTAssertEqual(resultPart.outcome, .ok)
XCTAssertEqual(resultPart.output, "hello")
}

func testInitWithMixedPartsIncludingExecutableCode() {
let textPart = TextPart("Here is some code:")
let executableCodePart = ExecutableCodePart(language: .python, code: "x = 1 + 2")
let codeExecutionResultPart = CodeExecutionResultPart(outcome: .ok, output: "3")

let content = ModelContent(
role: "model",
parts: [textPart, executableCodePart, codeExecutionResultPart]
)

XCTAssertEqual(content.role, "model")
XCTAssertEqual(content.parts.count, 3)

// Verify each part type
XCTAssertTrue(content.parts[0] is TextPart)
XCTAssertTrue(content.parts[1] is ExecutableCodePart)
XCTAssertTrue(content.parts[2] is CodeExecutionResultPart)
}

func testInitWithExecutableCodePartPreservesThoughtMetadata() {
// Test that thought-related metadata is preserved through the conversion
let executableCode = ExecutableCode(
language: ExecutableCode.Language(kind: .python),
code: "print('test')"
)
let internalExecutableCodePart = ExecutableCodePart(
executableCode,
isThought: true,
thoughtSignature: "some-signature"
)

// Verify metadata is set correctly on the part itself
XCTAssertTrue(internalExecutableCodePart.isThought)
XCTAssertEqual(internalExecutableCodePart.thoughtSignature, "some-signature")
Comment on lines +79 to +87
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

The variable name internalExecutableCodePart is a bit confusing as it refers to an instance of the public ExecutableCodePart type. Renaming it to executableCodePart would improve clarity.

Additionally, the assertions on lines 86-87 verify the initial state of the part before it's processed by ModelContent. Since the test's main purpose is to confirm that ModelContent preserves these properties, these initial checks are redundant with the final assertions on lines 99-100. Removing them would make the test more focused on the behavior of ModelContent initialization.

Suggested change
let internalExecutableCodePart = ExecutableCodePart(
executableCode,
isThought: true,
thoughtSignature: "some-signature"
)
// Verify metadata is set correctly on the part itself
XCTAssertTrue(internalExecutableCodePart.isThought)
XCTAssertEqual(internalExecutableCodePart.thoughtSignature, "some-signature")
let executableCodePart = ExecutableCodePart(
executableCode,
isThought: true,
thoughtSignature: "some-signature"
)


let content = ModelContent(role: "model", parts: [internalExecutableCodePart])

guard let resultPart = content.parts.first as? ExecutableCodePart else {
XCTFail("Expected ExecutableCodePart")
return
}

// Verify the part maintains its properties after round-trip
XCTAssertEqual(resultPart.language, .python)
XCTAssertEqual(resultPart.code, "print('test')")
XCTAssertTrue(resultPart.isThought)
XCTAssertEqual(resultPart.thoughtSignature, "some-signature")
}

func testInitWithCodeExecutionResultPartWithDeadlockedOutcome() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

The test name testInitWithCodeExecutionResultPartWithDeadlockedOutcome is slightly misleading because the test uses the .deadlineExceeded outcome, which isn't the same as a deadlock. To make the test's intent clearer, consider renaming it to better reflect the outcome being tested.

Suggested change
func testInitWithCodeExecutionResultPartWithDeadlockedOutcome() {
func testInitWithCodeExecutionResultPartWithDeadlineExceededOutcome() {

let codeExecutionResultPart = CodeExecutionResultPart(outcome: .deadlineExceeded, output: nil)

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, tvOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, tvOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, tvOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, tvOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, tvOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, catalyst)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, catalyst)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, catalyst)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, catalyst)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, catalyst)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, tvOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, tvOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, tvOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, tvOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, tvOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, watchOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, watchOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, watchOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, watchOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, watchOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, macOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, macOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, macOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, macOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, macOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, macOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, macOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, macOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, macOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, macOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, iOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, iOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, iOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, iOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, iOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, catalyst)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, catalyst)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, catalyst)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, catalyst)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, catalyst)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, watchOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, watchOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, watchOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, watchOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, watchOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, iOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, iOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, iOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, iOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, iOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, visionOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, visionOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, visionOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, visionOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, visionOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, visionOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, visionOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, visionOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, visionOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, visionOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-14, Xcode_16.2, iOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-14, Xcode_16.2, iOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-14, Xcode_16.2, iOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-14, Xcode_16.2, iOS)

'nil' is not compatible with expected argument type 'String'

Check failure on line 104 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-14, Xcode_16.2, iOS)

'nil' is not compatible with expected argument type 'String'

let content = ModelContent(role: "model", parts: [codeExecutionResultPart])

guard let resultPart = content.parts.first as? CodeExecutionResultPart else {
XCTFail("Expected CodeExecutionResultPart")
return
}
XCTAssertEqual(resultPart.outcome, .deadlineExceeded)

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, tvOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, tvOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, tvOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, tvOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, tvOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, catalyst)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, catalyst)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, catalyst)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, catalyst)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, catalyst)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, tvOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, tvOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, tvOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, tvOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, tvOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, watchOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, watchOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, watchOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, watchOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, watchOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, macOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, macOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, macOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, macOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, macOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, macOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, macOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, macOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, macOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, macOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, iOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, iOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, iOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, iOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, iOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, catalyst)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, catalyst)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, catalyst)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, catalyst)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, catalyst)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, watchOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, watchOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, watchOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, watchOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, watchOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, iOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, iOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, iOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, iOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, iOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, visionOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, visionOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, visionOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, visionOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-15, Xcode_16.4, visionOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, visionOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, visionOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, visionOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, visionOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-26, Xcode_26.2, visionOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-14, Xcode_16.2, iOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-14, Xcode_16.2, iOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-14, Xcode_16.2, iOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-14, Xcode_16.2, iOS)

type 'Equatable' has no member 'deadlineExceeded'

Check failure on line 112 in FirebaseAI/Tests/Unit/ModelContentTests.swift

View workflow job for this annotation

GitHub Actions / spm (FirebaseAILogicUnit) / spm (macos-14, Xcode_16.2, iOS)

type 'Equatable' has no member 'deadlineExceeded'
XCTAssertNil(resultPart.output)
}
}
Loading