Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ struct ConversationScreen: View {
}
}
}
.navigationTitle("Chat sample")
.navigationTitle("Chat example")
.onAppear {
focusedField = .message
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,6 @@ struct ErrorView: View {
ErrorView(error: errorPromptBlocked)
}
.listStyle(.plain)
.navigationTitle("Chat sample")
.navigationTitle("Chat example")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ struct MessageView_Previews: PreviewProvider {
MessageView(message: ChatMessage(message: "Hello!", participant: .system, pending: true))
}
.listStyle(.plain)
.navigationTitle("Chat sample")
.navigationTitle("Chat example")
}
}
}
60 changes: 30 additions & 30 deletions firebaseai/FirebaseAIExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
86C1F4842BC726150026816F /* FunctionCallingViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86C1F4802BC726150026816F /* FunctionCallingViewModel.swift */; };
88263BF02B239C09008AB09B /* ErrorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88263BEE2B239BFE008AB09B /* ErrorView.swift */; };
88263BF12B239C11008AB09B /* ErrorDetailsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 889873842B208563005B4896 /* ErrorDetailsView.swift */; };
8848C8332B0D04BC007B434F /* FirebaseAISampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8848C8322B0D04BC007B434F /* FirebaseAISampleApp.swift */; };
8848C8332B0D04BC007B434F /* FirebaseAIExampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8848C8322B0D04BC007B434F /* FirebaseAIExampleApp.swift */; };
8848C8352B0D04BC007B434F /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8848C8342B0D04BC007B434F /* ContentView.swift */; };
8848C8372B0D04BD007B434F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8848C8362B0D04BD007B434F /* Assets.xcassets */; };
8848C83A2B0D04BD007B434F /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8848C8392B0D04BD007B434F /* Preview Assets.xcassets */; };
Expand Down Expand Up @@ -41,8 +41,8 @@
88209C1B2B0FBDC300F64795 /* GenerateContentScreen.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GenerateContentScreen.swift; sourceTree = "<group>"; };
88209C1D2B0FBDC300F64795 /* GenerateContentViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GenerateContentViewModel.swift; sourceTree = "<group>"; };
88263BEE2B239BFE008AB09B /* ErrorView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ErrorView.swift; sourceTree = "<group>"; };
8848C82F2B0D04BC007B434F /* FirebaseAISample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FirebaseAISample.app; sourceTree = BUILT_PRODUCTS_DIR; };
8848C8322B0D04BC007B434F /* FirebaseAISampleApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirebaseAISampleApp.swift; sourceTree = "<group>"; };
8848C82F2B0D04BC007B434F /* FirebaseAIExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FirebaseAIExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
8848C8322B0D04BC007B434F /* FirebaseAIExampleApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirebaseAIExampleApp.swift; sourceTree = "<group>"; };
8848C8342B0D04BC007B434F /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
8848C8362B0D04BD007B434F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
8848C8392B0D04BD007B434F /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -93,13 +93,13 @@
path = ViewModels;
sourceTree = "<group>";
};
86C1F4822BC726150026816F /* FunctionCallingSample */ = {
86C1F4822BC726150026816F /* FunctionCallingExample */ = {
isa = PBXGroup;
children = (
86C1F4812BC726150026816F /* ViewModels */,
86C1F47F2BC726150026816F /* Screens */,
);
path = FunctionCallingSample;
path = FunctionCallingExample;
sourceTree = "<group>";
};
8802666E2B0FC39000CF7CB6 /* ViewModels */ = {
Expand Down Expand Up @@ -147,11 +147,11 @@
DEFECAA82D7B4CCD00EF9621 /* ImagenScreen */,
88B8A9352B0FCBA700424728 /* GenerativeAIUIComponents */,
869200B22B879C4F00482873 /* GoogleService-Info.plist */,
8848C8312B0D04BC007B434F /* FirebaseAISample */,
8848C8452B0D051E007B434F /* GenerativeAITextSample */,
8848C8572B0D056C007B434F /* GenerativeAIMultimodalSample */,
88E10F432B110D5300C08E95 /* ChatSample */,
86C1F4822BC726150026816F /* FunctionCallingSample */,
8848C8312B0D04BC007B434F /* FirebaseAIExample */,
8848C8452B0D051E007B434F /* GenerativeAITextExample */,
8848C8572B0D056C007B434F /* GenerativeAIMultimodalExample */,
88E10F432B110D5300C08E95 /* ChatExample */,
86C1F4822BC726150026816F /* FunctionCallingExample */,
8848C8302B0D04BC007B434F /* Products */,
88209C222B0FBE1700F64795 /* Frameworks */,
);
Expand All @@ -160,20 +160,20 @@
8848C8302B0D04BC007B434F /* Products */ = {
isa = PBXGroup;
children = (
8848C82F2B0D04BC007B434F /* FirebaseAISample.app */,
8848C82F2B0D04BC007B434F /* FirebaseAIExample.app */,
);
name = Products;
sourceTree = "<group>";
};
8848C8312B0D04BC007B434F /* FirebaseAISample */ = {
8848C8312B0D04BC007B434F /* FirebaseAIExample */ = {
isa = PBXGroup;
children = (
8848C8322B0D04BC007B434F /* FirebaseAISampleApp.swift */,
8848C8322B0D04BC007B434F /* FirebaseAIExampleApp.swift */,
8848C8342B0D04BC007B434F /* ContentView.swift */,
8848C8362B0D04BD007B434F /* Assets.xcassets */,
8848C8382B0D04BD007B434F /* Preview Content */,
);
path = FirebaseAISample;
path = FirebaseAIExample;
sourceTree = "<group>";
};
8848C8382B0D04BD007B434F /* Preview Content */ = {
Expand All @@ -184,15 +184,15 @@
path = "Preview Content";
sourceTree = "<group>";
};
8848C8452B0D051E007B434F /* GenerativeAITextSample */ = {
8848C8452B0D051E007B434F /* GenerativeAITextExample */ = {
isa = PBXGroup;
children = (
88209C1C2B0FBDC300F64795 /* ViewModels */,
88209C1A2B0FBDC300F64795 /* Screens */,
8848C84A2B0D051F007B434F /* Assets.xcassets */,
8848C84C2B0D051F007B434F /* Preview Content */,
);
path = GenerativeAITextSample;
path = GenerativeAITextExample;
sourceTree = "<group>";
};
8848C84C2B0D051F007B434F /* Preview Content */ = {
Expand All @@ -203,15 +203,15 @@
path = "Preview Content";
sourceTree = "<group>";
};
8848C8572B0D056C007B434F /* GenerativeAIMultimodalSample */ = {
8848C8572B0D056C007B434F /* GenerativeAIMultimodalExample */ = {
isa = PBXGroup;
children = (
8802666E2B0FC39000CF7CB6 /* ViewModels */,
880266742B0FC39000CF7CB6 /* Screens */,
8848C85C2B0D056D007B434F /* Assets.xcassets */,
8848C85E2B0D056D007B434F /* Preview Content */,
);
path = GenerativeAIMultimodalSample;
path = GenerativeAIMultimodalExample;
sourceTree = "<group>";
};
8848C85E2B0D056D007B434F /* Preview Content */ = {
Expand All @@ -222,7 +222,7 @@
path = "Preview Content";
sourceTree = "<group>";
};
88E10F432B110D5300C08E95 /* ChatSample */ = {
88E10F432B110D5300C08E95 /* ChatExample */ = {
isa = PBXGroup;
children = (
88E10F522B11124A00C08E95 /* Models */,
Expand All @@ -232,7 +232,7 @@
88E10F482B110D5400C08E95 /* Assets.xcassets */,
88E10F4A2B110D5400C08E95 /* Preview Content */,
);
path = ChatSample;
path = ChatExample;
sourceTree = "<group>";
};
88E10F4A2B110D5400C08E95 /* Preview Content */ = {
Expand Down Expand Up @@ -290,9 +290,9 @@
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
8848C82E2B0D04BC007B434F /* FirebaseAISample */ = {
8848C82E2B0D04BC007B434F /* FirebaseAIExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = 8848C83D2B0D04BD007B434F /* Build configuration list for PBXNativeTarget "FirebaseAISample" */;
buildConfigurationList = 8848C83D2B0D04BD007B434F /* Build configuration list for PBXNativeTarget "FirebaseAIExample" */;
buildPhases = (
8848C82B2B0D04BC007B434F /* Sources */,
8848C82C2B0D04BC007B434F /* Frameworks */,
Expand All @@ -302,14 +302,14 @@
);
dependencies = (
);
name = FirebaseAISample;
name = FirebaseAIExample;
packageProductDependencies = (
886F95D72B17BA420036F07A /* MarkdownUI */,
886F95E22B17D6630036F07A /* GenerativeAIUIComponents */,
DE26D95E2DBB3E9F007E6668 /* FirebaseAI */,
);
productName = GenerativeAISample;
productReference = 8848C82F2B0D04BC007B434F /* FirebaseAISample.app */;
productName = GenerativeAIExample;
productReference = 8848C82F2B0D04BC007B434F /* FirebaseAIExample.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
Expand Down Expand Up @@ -345,7 +345,7 @@
projectDirPath = "";
projectRoot = "";
targets = (
8848C82E2B0D04BC007B434F /* FirebaseAISample */,
8848C82E2B0D04BC007B434F /* FirebaseAIExample */,
);
};
/* End PBXProject section */
Expand Down Expand Up @@ -375,7 +375,7 @@
88263BF12B239C11008AB09B /* ErrorDetailsView.swift in Sources */,
8848C8352B0D04BC007B434F /* ContentView.swift in Sources */,
886F95D52B17BA010036F07A /* GenerateContentScreen.swift in Sources */,
8848C8332B0D04BC007B434F /* FirebaseAISampleApp.swift in Sources */,
8848C8332B0D04BC007B434F /* FirebaseAIExampleApp.swift in Sources */,
886F95E02B17D5010036F07A /* ConversationViewModel.swift in Sources */,
886F95DD2B17D5010036F07A /* MessageView.swift in Sources */,
886F95DC2B17BAEF0036F07A /* PhotoReasoningScreen.swift in Sources */,
Expand Down Expand Up @@ -517,7 +517,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"FirebaseAISample/Preview Content\"";
DEVELOPMENT_ASSET_PATHS = "\"FirebaseAIExample/Preview Content\"";
DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
Expand Down Expand Up @@ -547,7 +547,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"FirebaseAISample/Preview Content\"";
DEVELOPMENT_ASSET_PATHS = "\"FirebaseAIExample/Preview Content\"";
DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
Expand Down Expand Up @@ -582,7 +582,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
8848C83D2B0D04BD007B434F /* Build configuration list for PBXNativeTarget "FirebaseAISample" */ = {
8848C83D2B0D04BD007B434F /* Build configuration list for PBXNativeTarget "FirebaseAIExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
8848C83E2B0D04BD007B434F /* Debug */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8848C82E2B0D04BC007B434F"
BuildableName = "FirebaseAISample.app"
BlueprintName = "FirebaseAISample"
BuildableName = "FirebaseAIExample.app"
BlueprintName = "FirebaseAIExample"
ReferencedContainer = "container:FirebaseAIExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
Expand Down Expand Up @@ -45,8 +45,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8848C82E2B0D04BC007B434F"
BuildableName = "FirebaseAISample.app"
BlueprintName = "FirebaseAISample"
BuildableName = "FirebaseAIExample.app"
BlueprintName = "FirebaseAIExample"
ReferencedContainer = "container:FirebaseAIExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
Expand All @@ -68,8 +68,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8848C82E2B0D04BC007B434F"
BuildableName = "FirebaseAISample.app"
BlueprintName = "FirebaseAISample"
BuildableName = "FirebaseAIExample.app"
BlueprintName = "FirebaseAIExample"
ReferencedContainer = "container:FirebaseAIExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct ContentView: View {
}
}

Section("Samples") {
Section("Examples") {
NavigationLink {
GenerateContentScreen(firebaseService: firebaseService)
} label: {
Expand Down Expand Up @@ -73,7 +73,7 @@ struct ContentView: View {
}
}
}
.navigationTitle("Generative AI Samples")
.navigationTitle("Generative AI Examples")
.onChange(of: selectedBackend) { newBackend in
firebaseService = newBackend.backendValue
// Note: This might cause views that hold the old service instance to misbehave
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class AppDelegate: NSObject, UIApplicationDelegate {
guard let bundleID = Bundle.main.bundleIdentifier else { fatalError() }
fatalError("""
You must create and/or download a valid `GoogleService-Info.plist` file for \(bundleID) from \
https://console.firebase.google.com to run this sample. Replace the existing \
https://console.firebase.google.com to run this example. Replace the existing \
`GoogleService-Info.plist` file in the `firebaseai` directory with this new file.
""")
}
Expand All @@ -38,7 +38,7 @@ class AppDelegate: NSObject, UIApplicationDelegate {
}

@main
struct FirebaseAISampleApp: App {
struct FirebaseAIExampleApp: App {
@UIApplicationDelegateAdaptor var appDelegate: AppDelegate

var body: some Scene {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct PhotoReasoningScreen: View {
.listStyle(.plain)
}
}
.navigationTitle("Multimodal sample")
.navigationTitle("Multimodal example")
.onAppear {
focusedField = .message
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct GenerateContentScreen: View {
}
.listStyle(.plain)
}
.navigationTitle("Text sample")
.navigationTitle("Text example")
}

private func onGenerateContentTapped() {
Expand Down
2 changes: 1 addition & 1 deletion firebaseai/ImagenScreen/ImagenScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ struct ImagenScreen: View {
ProgressOverlay()
}
}
.navigationTitle("Imagen sample")
.navigationTitle("Imagen example")
.onAppear {
focusedField = .message
}
Expand Down
7 changes: 4 additions & 3 deletions firebaseai/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Firebase AI Sample App
# Firebase AI Quickstart

This sample demonstrates how to make calls to the Gemini API via Firebase directly
from your app, rather than server-side, using the
Expand All @@ -10,12 +10,12 @@ from your app, rather than server-side, using the

1. Clone this repo.
1. Change into the `firebaseai` directory.
1. Open `FirebaseAISample.xcodeproj` using Xcode.
1. Open `FirebaseAIExample.xcodeproj` using Xcode.

```bash
git clone https://github.com/firebase/quickstart-ios.git
cd quickstart-ios/firebaseai
open FirebaseAISample.xcodeproj
open FirebaseAIExample.xcodeproj
```

### Connect the sample to your Firebase project
Expand All @@ -30,6 +30,7 @@ sample app to your Firebase project (or create a new project):
- The default bundle ID is `com.google.firebase.quickstart.FirebaseAIExample`
3. Download the `GoogleService-Info.plist` for the app when prompted and save
it to the `firebaseai` directory.
4. In the Firebase Console, click **AI** and select **AI Logic** to enable the Gemini Developer API and Vertex AI Gemini API.

You should now be able to build and run the sample!

Expand Down