Skip to content

Commit 5a1d836

Browse files
committed
Fix doc links + default to false for nullable bools
1 parent 84adb36 commit 5a1d836

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

FirebaseAI/Sources/Types/Public/Live/LiveServerContent.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,35 @@ public struct LiveServerContent: Sendable {
2525
/// The content that the model has generated as part of the current
2626
/// conversation with the user.
2727
///
28-
/// This can be ``null`` if the message signifies something else (such
28+
/// This can be `nil` if the message signifies something else (such
2929
/// as the turn ending).
3030
public var modelTurn: ModelContent? { serverContent.modelTurn }
3131

3232
/// The model has finished sending data in the current turn.
3333
///
3434
/// Generation will only start in response to additional client messages.
3535
///
36-
/// Can be set alongside ``content``, indicating that the ``content`` is
36+
/// Can be set alongside `content`, indicating that the `content` is
3737
/// the last in the turn.
38-
public var isTurnComplete: Bool? { serverContent.turnComplete }
38+
public var isTurnComplete: Bool { serverContent.turnComplete ?? false }
3939

4040
/// The model was interrupted by a client message while generating data.
4141
///
4242
/// If the client is playing out the content in realtime, this is a
4343
/// good signal to stop and empty the current queue.
44-
public var wasInterrupted: Bool? { serverContent.interrupted }
44+
public var wasInterrupted: Bool { serverContent.interrupted ?? false }
4545

4646
/// The model has finished _generating_ data for the current turn.
4747
///
4848
/// For realtime playback, there will be a delay between when the model finishes generating
49-
/// content and the client has finished playing back the generated content. ``generationComplete``
50-
/// indicates that the model is done generating data, while ``isturnComplete`` indicates the model
49+
/// content and the client has finished playing back the generated content. `generationComplete`
50+
/// indicates that the model is done generating data, while `isturnComplete` indicates the model
5151
/// is waiting for additional client messages. Sending a message during this delay may cause a
52-
/// ``wasInterrupted`` message to be sent.
52+
/// `wasInterrupted` message to be sent.
5353
///
54-
/// Note that if the model ``wasInterrupted``, this will not be set. The model will go from
55-
/// ``wasInterrupted`` -> ``turnComplete``.
56-
public var isGenerationComplete: Bool? { serverContent.generationComplete }
54+
/// Note that if the model `wasInterrupted`, this will not be set. The model will go from
55+
/// `wasInterrupted` -> `turnComplete`.
56+
public var isGenerationComplete: Bool { serverContent.generationComplete ?? false }
5757

5858
/// Metadata specifing the sources used to ground generated content.
5959
public var groundingMetadata: GroundingMetadata? { serverContent.groundingMetadata }

FirebaseAI/Sources/Types/Public/Live/LiveSession.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public final class LiveSession: Sendable {
9999
/// - turnComplete: Whether the server should start generating content with the currently
100100
/// accumulated prompt, or await additional messages before starting generation. By default,
101101
/// the server will await additional messages.
102-
public func sendContent(_ content: [ModelContent], turnComplete: Bool? = nil) async {
102+
public func sendContent(_ content: [ModelContent], turnComplete: Bool = false) async {
103103
let message = BidiGenerateContentClientContent(turns: content, turnComplete: turnComplete)
104104
await service.send(.clientContent(message))
105105
}
@@ -120,7 +120,7 @@ public final class LiveSession: Sendable {
120120
/// accumulated prompt, or await additional messages before starting generation. By default,
121121
/// the server will await additional messages.
122122
public func sendContent(_ parts: any PartsRepresentable...,
123-
turnComplete: Bool? = nil) async {
123+
turnComplete: Bool = false) async {
124124
await sendContent([ModelContent(parts: parts)], turnComplete: turnComplete)
125125
}
126126

0 commit comments

Comments
 (0)