File tree Expand file tree Collapse file tree 5 files changed +15
-15
lines changed
firebaseai/FirebaseAIExample Expand file tree Collapse file tree 5 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ struct LiveScreen: View {
2828 self . backendType = backendType
2929 _viewModel =
3030 StateObject ( wrappedValue: LiveViewModel ( backendType: backendType,
31- sample: sample) )
31+ sample: sample) )
3232 }
3333
3434 var body : some View {
@@ -50,11 +50,11 @@ struct LiveScreen: View {
5050 )
5151 }
5252 . padding ( )
53- . navigationTitle ( viewModel. title)
54- . navigationBarTitleDisplayMode ( . inline)
55- . background ( viewModel. backgroundColor ?? . clear)
56- }
53+ . navigationTitle ( viewModel. title)
54+ . navigationBarTitleDisplayMode ( . inline)
55+ . background ( viewModel. backgroundColor ?? . clear)
5756 }
57+ }
5858
5959#Preview {
6060 LiveScreen ( backendType: . googleAI)
Original file line number Diff line number Diff line change @@ -63,7 +63,8 @@ class LiveViewModel: ObservableObject {
6363 : FirebaseAI . firebaseAI ( backend: . vertexAI( ) )
6464
6565 model = firebaseService. liveModel (
66- modelName: ( backendType == . googleAI) ? " gemini-2.5-flash-native-audio-preview-09-2025 " : " gemini-live-2.5-flash-preview-native-audio-09-2025 " ,
66+ modelName: ( backendType == . googleAI) ? " gemini-2.5-flash-native-audio-preview-09-2025 " :
67+ " gemini-live-2.5-flash-preview-native-audio-09-2025 " ,
6768 generationConfig: sample? . liveGenerationConfig,
6869 tools: sample? . tools,
6970 systemInstruction: sample? . systemInstruction
@@ -81,7 +82,7 @@ class LiveViewModel: ObservableObject {
8182 }
8283
8384 #if targetEnvironment(simulator)
84- logger. warning ( " Playback audio is disabled on the simulator. " )
85+ logger. warning ( " Playback audio is disabled on the simulator. " )
8586 #endif
8687
8788 guard await requestRecordPermission ( ) else {
@@ -211,7 +212,7 @@ class LiveViewModel: ObservableObject {
211212 if let part = part as? InlineDataPart {
212213 if part. mimeType. starts ( with: " audio/pcm " ) {
213214 #if !targetEnvironment(simulator)
214- try await audioController? . playAudio ( audio: part. data)
215+ try await audioController? . playAudio ( audio: part. data)
215216 #endif
216217 } else {
217218 logger. warning ( " Received non audio inline data part: \( part. mimeType) " )
Original file line number Diff line number Diff line change @@ -73,11 +73,11 @@ struct ConnectButton: View {
7373 lineWidth: 3
7474 )
7575 ) . tint ( color)
76- . onAppear {
77- withAnimation ( . linear( duration: 5 ) . repeatForever ( autoreverses: false ) ) {
78- self . gradientAngle = . degrees( 360 )
76+ . onAppear {
77+ withAnimation ( . linear( duration: 5 ) . repeatForever ( autoreverses: false ) ) {
78+ self . gradientAngle = . degrees( 360 )
79+ }
7980 }
80- }
8181 }
8282
8383 private func onClick( ) {
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ struct TranscriptView: View {
2525 . transition ( . opacity)
2626 . padding ( . horizontal)
2727 . id ( " transcript " )
28- } . onChange ( of: typewriter. text, initial: false ) { ( old, new) in
28+ } . onChange ( of: typewriter. text, initial: false ) { old, new in
2929 proxy. scrollTo ( " transcript " , anchor: . bottom)
3030 }
3131 }
Original file line number Diff line number Diff line change @@ -308,8 +308,7 @@ extension Sample {
308308 outputAudioTranscription: AudioTranscriptionConfig ( )
309309 ) ,
310310 tip: " Try asking the model to change the background color " ,
311-
312- )
311+ ) ,
313312 ]
314313
315314 public static var sample = samples [ 0 ]
You can’t perform that action at this time.
0 commit comments