-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/ah/release-10.26-merge-ca'
- Loading branch information
Showing
117 changed files
with
9,100 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: vertexai | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'FirebaseVertexAI**' | ||
- '.github/workflows/vertexai.yml' | ||
- 'Gemfile*' | ||
schedule: | ||
# Run every day at 11pm (PST) - cron uses UTC times | ||
- cron: '0 7 * * *' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
spm: | ||
strategy: | ||
matrix: | ||
target: [iOS, macOS, catalyst] | ||
os: [macos-13] | ||
include: | ||
- os: macos-13 | ||
xcode: Xcode_15.2 | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Xcode | ||
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer | ||
- name: Initialize xcodebuild | ||
run: scripts/setup_spm_tests.sh | ||
- uses: nick-fields/retry@v3 | ||
with: | ||
timeout_minutes: 120 | ||
max_attempts: 3 | ||
retry_on: error | ||
retry_wait_seconds: 120 | ||
command: scripts/build.sh FirebaseVertexAIUnit ${{ matrix.target }} spm | ||
|
||
sample: | ||
strategy: | ||
matrix: | ||
# Test build with debug and release configs (whether or not DEBUG is set and optimization level) | ||
build: [build] | ||
include: | ||
- os: macos-13 | ||
xcode: Xcode_15.0.1 | ||
- os: macos-14 | ||
xcode: Xcode_15.2 | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Xcode | ||
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer | ||
- name: Initialize xcodebuild | ||
run: xcodebuild -list | ||
- name: Placeholder GoogleService-Info.plist for build testing | ||
run: cp FirebaseCore/Tests/Unit/Resources/GoogleService-Info.plist FirebaseVertexAI/Sample/ | ||
- uses: nick-fields/retry@v3 | ||
with: | ||
timeout_minutes: 120 | ||
max_attempts: 3 | ||
retry_on: error | ||
retry_wait_seconds: 120 | ||
command: scripts/build.sh VertexSample iOS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
Pod::Spec.new do |s| | ||
s.name = 'FirebaseVertexAI' | ||
s.version = '10.26.0' | ||
s.summary = 'Firebase VertexAI' | ||
|
||
s.description = <<-DESC | ||
Placeholder podspec for docsgen only. Do not use this pod. | ||
DESC | ||
|
||
s.homepage = 'https://firebase.google.com' | ||
s.license = { :type => 'Apache-2.0', :file => 'LICENSE' } | ||
s.authors = 'Google, Inc.' | ||
|
||
s.source = { | ||
:git => 'https://github.com/firebase/firebase-ios-sdk.git', | ||
# TODO: this should be `'CocoaPods-' + s.version.to_s` (after May 14 2024) | ||
:tag => 'release-10.26' | ||
} | ||
|
||
s.social_media_url = 'https://twitter.com/Firebase' | ||
|
||
ios_deployment_target = '15.0' | ||
osx_deployment_target = '10.14' | ||
|
||
s.ios.deployment_target = ios_deployment_target | ||
s.osx.deployment_target = osx_deployment_target | ||
|
||
s.cocoapods_version = '>= 1.12.0' | ||
s.prefix_header_file = false | ||
|
||
s.source_files = [ | ||
'FirebaseVertexAI/Sources/**/*.swift', | ||
'FirebaseCore/Extension/*.h', | ||
'FirebaseAuth/Interop/*.h', | ||
] | ||
|
||
s.swift_version = '5.3' | ||
|
||
s.framework = 'Foundation' | ||
s.ios.framework = 'UIKit' | ||
s.osx.framework = 'AppKit' | ||
s.tvos.framework = 'UIKit' | ||
s.watchos.framework = 'WatchKit' | ||
|
||
s.dependency 'FirebaseCore', '~> 10.0' | ||
s.dependency 'FirebaseCoreExtension' | ||
s.dependency 'FirebaseAuthInterop' | ||
s.dependency 'FirebaseAppCheckInterop', '~> 10.17' | ||
|
||
s.pod_target_xcconfig = { | ||
'GCC_C_LANGUAGE_STANDARD' => 'c99', | ||
'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}"', | ||
'OTHER_CFLAGS' => '-fno-autolink' | ||
} | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# 10.26.0 | ||
|
||
- [feature] Initial release of the Vertex AI for Firebase SDK (public preview). | ||
Learn how to | ||
[get started](https://firebase.google.com/docs/vertex-ai/get-started?platform=ios) | ||
with the SDK in your app. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Vertex AI for Firebase SDK | ||
|
||
**Preview**: Vertex AI for Firebase is in Public Preview, which means that the product is | ||
not subject to any SLA or deprecation policy and could change in backwards-incompatible | ||
ways. | ||
|
||
- For developer documentation, please visit https://firebase.google.com/docs/vertex-ai. | ||
- Try out the [sample app](Sample/README.md) to get started. |
11 changes: 11 additions & 0 deletions
11
FirebaseVertexAI/Sample/ChatSample/Assets.xcassets/AccentColor.colorset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
FirebaseVertexAI/Sample/ChatSample/Assets.xcassets/AppIcon.appiconset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"platform" : "ios", | ||
"size" : "1024x1024" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
FirebaseVertexAI/Sample/ChatSample/Assets.xcassets/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
FirebaseVertexAI/Sample/ChatSample/Models/ChatMessage.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Copyright 2023 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 | ||
|
||
enum Participant { | ||
case system | ||
case user | ||
} | ||
|
||
struct ChatMessage: Identifiable, Equatable { | ||
let id = UUID().uuidString | ||
var message: String | ||
let participant: Participant | ||
var pending = false | ||
|
||
static func pending(participant: Participant) -> ChatMessage { | ||
Self(message: "", participant: participant, pending: true) | ||
} | ||
} | ||
|
||
extension ChatMessage { | ||
static var samples: [ChatMessage] = [ | ||
.init(message: "Hello. What can I do for you today?", participant: .system), | ||
.init(message: "Show me a simple loop in Swift.", participant: .user), | ||
.init(message: """ | ||
Sure, here is a simple loop in Swift: | ||
# Example 1 | ||
``` | ||
for i in 1...5 { | ||
print("Hello, world!") | ||
} | ||
``` | ||
This loop will print the string "Hello, world!" five times. The for loop iterates over a range of numbers, | ||
in this case the numbers from 1 to 5. The variable i is assigned each number in the range, and the code inside the loop is executed. | ||
**Here is another example of a simple loop in Swift:** | ||
```swift | ||
var sum = 0 | ||
for i in 1...100 { | ||
sum += i | ||
} | ||
print("The sum of the numbers from 1 to 100 is \\(sum).") | ||
``` | ||
This loop calculates the sum of the numbers from 1 to 100. The variable sum is initialized to 0, and then the for loop iterates over the range of numbers from 1 to 100. The variable i is assigned each number in the range, and the value of i is added to the sum variable. After the loop has finished executing, the value of sum is printed to the console. | ||
""", participant: .system), | ||
] | ||
|
||
static var sample = samples[0] | ||
} |
6 changes: 6 additions & 0 deletions
6
FirebaseVertexAI/Sample/ChatSample/Preview Content/Preview Assets.xcassets/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Oops, something went wrong.