Skip to content

Commit 9527026

Browse files
committed
Formatting
1 parent c4339fa commit 9527026

File tree

4 files changed

+30
-27
lines changed

4 files changed

+30
-27
lines changed

FirebaseAI/Sources/Types/Internal/Live/BidiGenerationConfig.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Foundation
1616

1717
/// Configuration options for live content generation.
1818
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
19-
internal struct BidiGenerationConfig: Encodable, Sendable {
19+
struct BidiGenerationConfig: Encodable, Sendable {
2020
let temperature: Float?
2121
let topP: Float?
2222
let topK: Int?
@@ -28,11 +28,10 @@ internal struct BidiGenerationConfig: Encodable, Sendable {
2828
let speechConfig: BidiSpeechConfig?
2929

3030
init(temperature: Float? = nil, topP: Float? = nil, topK: Int? = nil,
31-
candidateCount: Int? = nil, maxOutputTokens: Int? = nil,
32-
presencePenalty: Float? = nil, frequencyPenalty: Float? = nil,
33-
responseModalities: [ResponseModality]? = nil,
34-
speechConfig: BidiSpeechConfig? = nil
35-
) {
31+
candidateCount: Int? = nil, maxOutputTokens: Int? = nil,
32+
presencePenalty: Float? = nil, frequencyPenalty: Float? = nil,
33+
responseModalities: [ResponseModality]? = nil,
34+
speechConfig: BidiSpeechConfig? = nil) {
3635
self.temperature = temperature
3736
self.topP = topP
3837
self.topK = topK

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414

1515
/// Configuration options for audio transcriptions when communicating with a live model.
1616
///
17-
/// While there are not currently any options, this will likely change in the future. For now, just providing
18-
/// an instance of this struct will enable audio transcriptions for the corresponding input or output fields.
17+
/// While there are not currently any options, this will likely change in the future. For now, just
18+
/// providing an instance of this struct will enable audio transcriptions for the corresponding
19+
/// input or output fields.
1920
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
2021
public struct AudioTranscriptionConfig: Sendable {
2122
let audioTranscriptionConfig: BidiAudioTranscriptionConfig

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

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -102,25 +102,28 @@ public struct LiveGenerationConfig: Sendable {
102102
/// > backwards-incompatible ways.
103103
/// - speechConfig: Controls the voice of the model, when streaming `audio` via
104104
/// ``ResponseModality``.
105-
/// - inputAudioTranscription: Configures (and enables) input transcriptions when streaming to the model.
105+
/// - inputAudioTranscription: Configures (and enables) input transcriptions when streaming to
106+
/// the model.
106107
///
107-
/// Input transcripts are the model's interprutation of audio data sent to it, and they are populated in model responses via ``LiveServerContent``.
108-
/// When this fields is set to `nil`, input transcripts are not populated in model responses.
109-
/// - outputAudioTranscription: Configures (and enables) output transcriptions when streaming to the model.
108+
/// Input transcripts are the model's interprutation of audio data sent to it, and they are
109+
/// populated in model responses via ``LiveServerContent``. When this fields is set to `nil`,
110+
/// input transcripts are not populated in model responses.
111+
/// - outputAudioTranscription: Configures (and enables) output transcriptions when streaming to
112+
/// the model.
110113
///
111-
/// Output transcripts are text representations of the audio the model is sending to the client, and they are populated in model responses via ``LiveServerContent``
112-
/// When this fields is set to `nil`, output transcripts are not populated in model responses.
114+
/// Output transcripts are text representations of the audio the model is sending to the
115+
/// client, and they are populated in model responses via ``LiveServerContent``. When this
116+
/// fields is set to `nil`, output transcripts are not populated in model responses.
113117
///
114-
/// > Important: Transcripts are independent to the model turn. This means transcripts may come earlier or later than when
115-
/// > the model sends the corresponding audio responses.
118+
/// > Important: Transcripts are independent to the model turn. This means transcripts may
119+
/// > come earlier or later than when the model sends the corresponding audio responses.
116120
public init(temperature: Float? = nil, topP: Float? = nil, topK: Int? = nil,
117121
candidateCount: Int? = nil, maxOutputTokens: Int? = nil,
118122
presencePenalty: Float? = nil, frequencyPenalty: Float? = nil,
119123
responseModalities: [ResponseModality]? = nil,
120124
speechConfig: SpeechConfig? = nil,
121125
inputAudioTranscription: AudioTranscriptionConfig? = nil,
122-
outputAudioTranscription: AudioTranscriptionConfig? = nil
123-
) {
126+
outputAudioTranscription: AudioTranscriptionConfig? = nil) {
124127
self.init(
125128
BidiGenerationConfig(
126129
temperature: temperature,
@@ -138,11 +141,9 @@ public struct LiveGenerationConfig: Sendable {
138141
)
139142
}
140143

141-
init(
142-
_ bidiGenerationConfig: BidiGenerationConfig,
143-
inputAudioTranscription: BidiAudioTranscriptionConfig? = nil,
144-
outputAudioTranscription: BidiAudioTranscriptionConfig? = nil
145-
) {
144+
init(_ bidiGenerationConfig: BidiGenerationConfig,
145+
inputAudioTranscription: BidiAudioTranscriptionConfig? = nil,
146+
outputAudioTranscription: BidiAudioTranscriptionConfig? = nil) {
146147
self.bidiGenerationConfig = bidiGenerationConfig
147148
self.inputAudioTranscription = inputAudioTranscription
148149
self.outputAudioTranscription = outputAudioTranscription

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,19 @@ public struct LiveServerContent: Sendable {
6262

6363
/// The model's interpretation of what the client said in an audio message.
6464
///
65-
/// This field is only populated when an ``AudioTranscriptionConfig`` is provided to ``LiveGenerationConfig``.
65+
/// This field is only populated when an ``AudioTranscriptionConfig`` is provided to
66+
/// ``LiveGenerationConfig``.
6667
public var inputTranscription: LiveTranscription? {
6768
serverContent.inputTranscription.map { LiveTranscription($0) }
6869
}
6970

7071
/// Transcription matching the model's audio response.
7172
///
72-
/// This field is only populated when an ``AudioTranscriptionConfig`` is provided to ``LiveGenerationConfig``.
73+
/// This field is only populated when an ``AudioTranscriptionConfig`` is provided to
74+
/// ``LiveGenerationConfig``.
7375
///
74-
/// > Important: Transcripts are independent to the model turn. This means transcripts may come earlier or later than when
75-
/// > the model sends the corresponding audio responses.
76+
/// > Important: Transcripts are independent to the model turn. This means transcripts may
77+
/// > come earlier or later than when the model sends the corresponding audio responses.
7678
public var outputTranscription: LiveTranscription? {
7779
serverContent.outputTranscription.map { LiveTranscription($0) }
7880
}

0 commit comments

Comments
 (0)