-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Ryan Wilson <[email protected]> Co-authored-by: Andrew Heard <[email protected]> Co-authored-by: Peter Friese <[email protected]> Co-authored-by: Morgan Chen <[email protected]>
- Loading branch information
1 parent
f630729
commit e1c52aa
Showing
109 changed files
with
7,498 additions
and
65 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,47 @@ | ||
name: check | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check: | ||
runs-on: macos-latest | ||
env: | ||
MINT_PATH: ${{ github.workspace }}/mint | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.6 | ||
|
||
- name: Cache Mint packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.MINT_PATH }} | ||
key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }} | ||
restore-keys: ${{ runner.os }}-mint- | ||
|
||
- name: Setup check | ||
run: | | ||
brew update | ||
brew install mint | ||
mint bootstrap | ||
- name: Style | ||
run: scripts/style.sh test-only | ||
|
||
- name: Whitespace | ||
run: scripts/check_whitespace.sh | ||
|
||
- name: Filename spaces | ||
run: scripts/check_filename_spaces.sh | ||
|
||
- name: Copyrights | ||
run: scripts/check_copyright.sh |
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,30 @@ | ||
name: cli | ||
|
||
on: | ||
pull_request: | ||
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: | ||
swift-build-run: | ||
strategy: | ||
matrix: | ||
target: [macOS] | ||
os: [macos-13] | ||
include: | ||
- os: macos-13 | ||
xcode: Xcode_15.0.1 | ||
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: Build CLI | ||
run: scripts/third_party/travis/retry.sh scripts/build.sh GenerativeAICLI macOS build Examples/GenerativeAICLI |
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,31 @@ | ||
name: samples | ||
|
||
on: | ||
pull_request: | ||
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: | ||
swift-build-run: | ||
strategy: | ||
matrix: | ||
# Test build with debug and release configs (whether or not DEBUG is set and optimization level) | ||
build: [build, archive] | ||
os: [macos-13] | ||
include: | ||
- os: macos-13 | ||
xcode: Xcode_15.0.1 | ||
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: Build the sample | ||
run: scripts/third_party/travis/retry.sh scripts/build.sh GenerativeAISample iOS ${{ matrix.build }} Examples/GenerativeAISample/GenerativeAISample.xcodeproj |
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,30 @@ | ||
name: spm | ||
|
||
on: | ||
pull_request: | ||
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: | ||
swift-build-run: | ||
strategy: | ||
matrix: | ||
target: [iOS, macOS] | ||
os: [macos-13] | ||
include: | ||
- os: macos-13 | ||
xcode: Xcode_15.0.1 | ||
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: Build and unit test | ||
run: scripts/third_party/travis/retry.sh scripts/build.sh generative-ai-swift ${{ matrix.target }} test |
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 |
---|---|---|
@@ -1,57 +1,38 @@ | ||
# Created by https://www.toptal.com/developers/gitignore/api/macos,xcode | ||
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,xcode | ||
|
||
### macOS ### | ||
# General | ||
# OS X | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
### macOS Patch ### | ||
# iCloud generated files | ||
*.icloud | ||
|
||
### Xcode ### | ||
## User settings | ||
# Xcode | ||
build/ | ||
*.pbxuser | ||
!default.pbxuser | ||
*.mode1v3 | ||
!default.mode1v3 | ||
*.mode2v3 | ||
!default.mode2v3 | ||
*.perspectivev3 | ||
!default.perspectivev3 | ||
xcuserdata/ | ||
|
||
## Xcode 8 and earlier | ||
*.xcscmblueprint | ||
*.xccheckout | ||
|
||
### Xcode Patch ### | ||
*.xcodeproj/* | ||
!*.xcodeproj/project.pbxproj | ||
!*.xcodeproj/xcshareddata/ | ||
!*.xcodeproj/project.xcworkspace/ | ||
!*.xcworkspace/contents.xcworkspacedata | ||
/*.gcno | ||
**/xcshareddata/WorkspaceSettings.xcsettings | ||
|
||
# End of https://www.toptal.com/developers/gitignore/api/macos,xcode | ||
|
||
# This file contains the PaLM API key - don't check it in | ||
PaLM-Info.plist | ||
profile | ||
*.moved-aside | ||
DerivedData | ||
*.hmap | ||
*.ipa | ||
*.xcworkspace | ||
|
||
# Swift Package Manager | ||
Package.resolved | ||
**/.build | ||
**/.swiftpm | ||
.netrc | ||
|
||
# Bad sorts get generated if the package .xcscheme is not regenerated. | ||
# Anything committed to xcshareddata gets propagated to clients. (#8167) | ||
.swiftpm/xcode/xcshareddata/ | ||
|
||
# Mint package manager | ||
Mint | ||
|
||
# CLI Tool | ||
Apps/GoogleAICLI/GoogleAICLI.xcodeproj/xcshareddata/xcschemes/* | ||
GenerativeAI-Info.plist |
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,37 @@ | ||
// swift-tools-version: 5.9 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
// 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 PackageDescription | ||
|
||
let package = Package( | ||
name: "GenerativeAICLI", | ||
platforms: [.macOS(.v13)], | ||
dependencies: [ | ||
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.2.0"), | ||
.package(name: "GoogleGenerativeAI", path: "../../"), | ||
], | ||
targets: [ | ||
.executableTarget( | ||
name: "generate-content", | ||
dependencies: [ | ||
.product(name: "ArgumentParser", package: "swift-argument-parser"), | ||
.product(name: "GoogleGenerativeAI", package: "GoogleGenerativeAI"), | ||
], | ||
path: "Sources" | ||
), | ||
] | ||
) |
Oops, something went wrong.