@@ -25,35 +25,35 @@ public struct LiveServerContent: Sendable {
25
25
/// The content that the model has generated as part of the current
26
26
/// conversation with the user.
27
27
///
28
- /// This can be ``null` ` if the message signifies something else (such
28
+ /// This can be `nil ` if the message signifies something else (such
29
29
/// as the turn ending).
30
30
public var modelTurn : ModelContent ? { serverContent. modelTurn }
31
31
32
32
/// The model has finished sending data in the current turn.
33
33
///
34
34
/// Generation will only start in response to additional client messages.
35
35
///
36
- /// Can be set alongside `` content`` , indicating that the `` content` ` is
36
+ /// Can be set alongside `content`, indicating that the `content` is
37
37
/// the last in the turn.
38
- public var isTurnComplete : Bool ? { serverContent. turnComplete }
38
+ public var isTurnComplete : Bool { serverContent. turnComplete ?? false }
39
39
40
40
/// The model was interrupted by a client message while generating data.
41
41
///
42
42
/// If the client is playing out the content in realtime, this is a
43
43
/// good signal to stop and empty the current queue.
44
- public var wasInterrupted : Bool ? { serverContent. interrupted }
44
+ public var wasInterrupted : Bool { serverContent. interrupted ?? false }
45
45
46
46
/// The model has finished _generating_ data for the current turn.
47
47
///
48
48
/// 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
51
51
/// 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.
53
53
///
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 }
57
57
58
58
/// Metadata specifing the sources used to ground generated content.
59
59
public var groundingMetadata : GroundingMetadata ? { serverContent. groundingMetadata }
0 commit comments