Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
53 changes: 36 additions & 17 deletions firebaseai/FirebaseAIExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
/* Begin PBXBuildFile section */
88151ADC2EC9345700775CFB /* MarkdownUI in Frameworks */ = {isa = PBXBuildFile; productRef = 88151ADB2EC9345700775CFB /* MarkdownUI */; };
88779D902EC8AA920080D023 /* ConversationKit in Frameworks */ = {isa = PBXBuildFile; productRef = 88779D8F2EC8AA920080D023 /* ConversationKit */; };
88779D932EC8AC460080D023 /* FirebaseAILogic in Frameworks */ = {isa = PBXBuildFile; productRef = 88779D922EC8AC460080D023 /* FirebaseAILogic */; };
88862D5D2FD7C19F003702C7 /* FirebaseAI in Frameworks */ = {isa = PBXBuildFile; productRef = 88862D5C2FD7C19F003702C7 /* FirebaseAI */; };
88862D5F2FD7C19F003702C7 /* FirebaseAILogic in Frameworks */ = {isa = PBXBuildFile; productRef = 88862D5E2FD7C19F003702C7 /* FirebaseAILogic */; };
88862D612FD7C19F003702C7 /* FirebaseAppCheck in Frameworks */ = {isa = PBXBuildFile; productRef = 88862D602FD7C19F003702C7 /* FirebaseAppCheck */; };
88862D632FD7C19F003702C7 /* FirebaseCore in Frameworks */ = {isa = PBXBuildFile; productRef = 88862D622FD7C19F003702C7 /* FirebaseCore */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -29,9 +32,12 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
88862D5F2FD7C19F003702C7 /* FirebaseAILogic in Frameworks */,
88151ADC2EC9345700775CFB /* MarkdownUI in Frameworks */,
88779D932EC8AC460080D023 /* FirebaseAILogic in Frameworks */,
88779D902EC8AA920080D023 /* ConversationKit in Frameworks */,
88862D612FD7C19F003702C7 /* FirebaseAppCheck in Frameworks */,
88862D632FD7C19F003702C7 /* FirebaseCore in Frameworks */,
88862D5D2FD7C19F003702C7 /* FirebaseAI in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -75,8 +81,11 @@
name = FirebaseAIExample;
packageProductDependencies = (
88779D8F2EC8AA920080D023 /* ConversationKit */,
88779D922EC8AC460080D023 /* FirebaseAILogic */,
88151ADB2EC9345700775CFB /* MarkdownUI */,
88862D5C2FD7C19F003702C7 /* FirebaseAI */,
88862D5E2FD7C19F003702C7 /* FirebaseAILogic */,
88862D602FD7C19F003702C7 /* FirebaseAppCheck */,
88862D622FD7C19F003702C7 /* FirebaseCore */,
);
productName = FirebaseAIExample;
productReference = 88779D352EC8A9CF0080D023 /* FirebaseAIExample.app */;
Expand Down Expand Up @@ -108,8 +117,8 @@
minimizedProjectReferenceProxies = 1;
packageReferences = (
88779D8E2EC8AA920080D023 /* XCRemoteSwiftPackageReference "ConversationKit" */,
88779D912EC8AC460080D023 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
88151ADA2EC9345700775CFB /* XCRemoteSwiftPackageReference "swift-markdown-ui" */,
88862D5B2FD7C19F003702C7 /* XCLocalSwiftPackageReference "../../firebase-ios-sdk" */,
);
preferredProjectObjectVersion = 77;
productRefGroup = 88779D362EC8A9CF0080D023 /* Products */;
Expand Down Expand Up @@ -268,7 +277,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = YGAZHQXHH4;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSMicrophoneUsageDescription = "The app needs access to your microphone to enable live voice conversations with Gemini.";
Expand Down Expand Up @@ -302,7 +311,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = YGAZHQXHH4;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSMicrophoneUsageDescription = "The app needs access to your microphone to enable live voice conversations with Gemini.";
Expand Down Expand Up @@ -352,6 +361,13 @@
};
/* End XCConfigurationList section */

/* Begin XCLocalSwiftPackageReference section */
88862D5B2FD7C19F003702C7 /* XCLocalSwiftPackageReference "../../firebase-ios-sdk" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = "../../firebase-ios-sdk";
};
/* End XCLocalSwiftPackageReference section */

/* Begin XCRemoteSwiftPackageReference section */
88151ADA2EC9345700775CFB /* XCRemoteSwiftPackageReference "swift-markdown-ui" */ = {
isa = XCRemoteSwiftPackageReference;
Expand All @@ -364,17 +380,9 @@
88779D8E2EC8AA920080D023 /* XCRemoteSwiftPackageReference "ConversationKit" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/peterfriese/ConversationKit";
requirement = {
kind = exactVersion;
version = 0.0.4;
};
};
88779D912EC8AC460080D023 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/firebase/firebase-ios-sdk";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 12.13.0;
minimumVersion = 0.0.4;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand All @@ -390,11 +398,22 @@
package = 88779D8E2EC8AA920080D023 /* XCRemoteSwiftPackageReference "ConversationKit" */;
productName = ConversationKit;
};
88779D922EC8AC460080D023 /* FirebaseAILogic */ = {
88862D5C2FD7C19F003702C7 /* FirebaseAI */ = {
isa = XCSwiftPackageProductDependency;
productName = FirebaseAI;
};
88862D5E2FD7C19F003702C7 /* FirebaseAILogic */ = {
isa = XCSwiftPackageProductDependency;
package = 88779D912EC8AC460080D023 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseAILogic;
};
88862D602FD7C19F003702C7 /* FirebaseAppCheck */ = {
isa = XCSwiftPackageProductDependency;
productName = FirebaseAppCheck;
};
88862D622FD7C19F003702C7 /* FirebaseCore */ = {
isa = XCSwiftPackageProductDependency;
productName = FirebaseCore;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 88779D2D2EC8A9CF0080D023 /* Project object */;
Expand Down
6 changes: 6 additions & 0 deletions firebaseai/FirebaseAIExample/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ struct ContentView: View {
GroundingScreen(backendType: selectedBackend, sample: sample)
case "LiveScreen":
LiveScreen(backendType: selectedBackend, sample: sample)
case "AppleAIScreen":
if #available(iOS 27.0, *) {
Comment thread
peterfriese marked this conversation as resolved.
AppleAIScreen()
} else {
Text("Apple Intelligence is only available on iOS 27 or newer.")
}
default:
EmptyView()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import Foundation
import FoundationModels

@available(iOS 26.0, *)
Comment thread
peterfriese marked this conversation as resolved.
@Generable
public struct Itinerary: Equatable, Codable {
@Guide(description: "An exciting name for the trip.")
public let title: String

@Guide(description: "The name of the destination.")
public let destinationName: String

@Guide(description: "A brief, catchy description of the trip.")
public let description: String

@Guide(description: "An explanation of why this plan fits the user's request.")
public let rationale: String

@Guide(description: "A list of day plans.")
public let days: [DayPlan]

@Guide(description: "Any source attributions or links for the recommended places.")
public let attributions: [Attribution]?
}

@available(iOS 26.0, *)
@Generable
public struct Attribution: Equatable, Codable {
public let title: String
public let url: String
}

@available(iOS 26.0, *)
@Generable
public struct DayPlan: Equatable, Codable {
@Guide(description: "A unique title for this day.")
public let title: String

public let subtitle: String

@Guide(description: "A list of activities planned for this day.")
public let activities: [Activity]
}

@available(iOS 26.0, *)
@Generable
public struct Activity: Equatable, Codable {
public let type: ActivityKind
public let title: String
public let description: String
public let latitude: Double?
public let longitude: Double?
}

@available(iOS 26.0, *)
@Generable
public enum ActivityKind: String, Codable {
case sightseeing
case foodAndDining
case shopping
case hotelAndLodging

public var displayName: String {
switch self {
case .sightseeing: return "Sightseeing"
case .foodAndDining: return "Food & Dining"
case .shopping: return "Shopping"
case .hotelAndLodging: return "Hotel & Lodging"
}
}
}

@available(iOS 26.0, *)
@Generable
public struct IdentifiedObject: Equatable, Codable {
@Guide(description: "The name of the primary object or landmark detected.")
public let name: String

@Guide(description: "The category of the object (e.g. Landmark, Plant, Food, Animal, Device, Clothing).")
public let category: String

@Guide(description: "A short, 2-sentence description of the object and interesting facts.")
public let description: String
}

@available(iOS 26.0, *)
@Generable
public struct TextSummary: Equatable, Codable {
@Guide(description: "A list of exactly 2 key summary points.")
public let summaryPoints: [String]
}
Loading
Loading