-
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.
- Loading branch information
Showing
4 changed files
with
53 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 |
---|---|---|
@@ -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
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 |
---|---|---|
@@ -1,13 +1,21 @@ | ||
# Developing | ||
|
||
## Re-generating the API | ||
All code in the [OpenAPI](../Sources/OpenAPI) is generated based on the API specification in [generativelanguage-v1beta3.json](../Sources/generativelanguage-v1beta3.json). | ||
## Prerequisites | ||
|
||
To re-generate the API based on any changes to the API, follow these steps: | ||
* Xcode 15 or newer | ||
|
||
* Obtain the API discovery document from https://generativelanguage.googleapis.com/$discovery/rest?version=v1beta3&key=$YOUR_API_KEY | ||
* Convert the discovery document to OpenAPI 3.0 (Swagger) format | ||
* https://github.com/APIs-guru/google-discovery-to-swagger | ||
* https://github.com/LucyBot-Inc/api-spec-converter | ||
* Use [CreateAPI](https://github.com/CreateAPI/CreateAPI) to generate helper classes for accessing the API | ||
* Manually write the API surface ([protocol](../Sources/GoogleGenerativeAI/GenerativeLanguageProtocol.swift) / [implementation)](../Sources/GoogleGenerativeAI/GenerativeLanguage.swift) and [REST routes for the API client](../Sources/GoogleGenerativeAI/Endpoints.swift) to access the API using the generated helper classes | ||
## Setting up your development environment | ||
|
||
* `git clone [email protected]:google/generative-ai-swift.git` | ||
* `open Package.swift` | ||
* Command-u to build and run the library and unit tests | ||
* `open Examples/GenerativeAISample/GenerativeAISample.xcodeproj` to build and run the Examples | ||
|
||
## Checking in code | ||
|
||
Before submitting a pull request, make sure to check your code against the | ||
style guide by running the following command: | ||
|
||
```bash | ||
$ ./scripts/style.sh | ||
``` |