ContentView.swift 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // Copyright 2023 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. import SwiftUI
  15. struct ContentView: View {
  16. @StateObject
  17. var viewModel = ConversationViewModel()
  18. @StateObject
  19. var functionCallingViewModel = FunctionCallingViewModel()
  20. var body: some View {
  21. NavigationStack {
  22. List {
  23. NavigationLink {
  24. SummarizeScreen()
  25. } label: {
  26. Label("Text", systemImage: "doc.text")
  27. }
  28. NavigationLink {
  29. PhotoReasoningScreen()
  30. } label: {
  31. Label("Multi-modal", systemImage: "doc.richtext")
  32. }
  33. NavigationLink {
  34. ConversationScreen()
  35. .environmentObject(viewModel)
  36. } label: {
  37. Label("Chat", systemImage: "ellipsis.message.fill")
  38. }
  39. NavigationLink {
  40. FunctionCallingScreen().environmentObject(functionCallingViewModel)
  41. } label: {
  42. Label("Function Calling", systemImage: "function")
  43. }
  44. NavigationLink {
  45. MultimodalOutputScreen()
  46. } label: {
  47. Label("Multimodal Output", systemImage: "rectangle.3.offgrid.fill")
  48. }
  49. }
  50. .navigationTitle("Generative AI Samples")
  51. }
  52. }
  53. }
  54. #Preview {
  55. ContentView()
  56. }