File tree Expand file tree Collapse file tree 1 file changed +4
-27
lines changed
FirebaseAI/Tests/TestApp/Sources Expand file tree Collapse file tree 1 file changed +4
-27
lines changed Original file line number Diff line number Diff line change 12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
14
15
- import FirebaseAI
16
15
import SwiftUI
17
16
18
17
struct ContentView : View {
19
- // TODO: Revert changes in this file. For prototyping purposes only.
20
- let liveModel : LiveGenerativeModel = {
21
- // let firebaseAI = FirebaseAI.firebaseAI(backend: .vertexAI())
22
- let firebaseAI = FirebaseAI . firebaseAI ( )
23
- return firebaseAI. liveModel (
24
- modelName: " gemini-2.0-flash-live-001 " ,
25
- generationConfig: LiveGenerationConfig ( responseModalities: [ . text] )
26
- )
27
- } ( )
28
-
29
- @State private var responses : [ String ] = [ ]
30
-
31
18
var body : some View {
32
19
VStack {
33
- List ( responses, id: \. self) {
34
- Text ( $0)
35
- }
20
+ Image ( systemName: " globe " )
21
+ . imageScale ( . large)
22
+ . foregroundStyle ( . tint)
23
+ Text ( " Hello, world! " )
36
24
}
37
25
. padding ( )
38
- . task {
39
- do {
40
- let liveSession = liveModel. connect ( )
41
- try await liveSession. sendMessage ( " Why is the sky blue? " )
42
- for try await response in liveSession. responses {
43
- responses. append ( String ( describing: response) )
44
- }
45
- } catch {
46
- print ( error)
47
- }
48
- }
49
26
}
50
27
}
51
28
You can’t perform that action at this time.
0 commit comments