-
Notifications
You must be signed in to change notification settings - Fork 152
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
1 changed file
with
22 additions
and
0 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,22 @@ | ||
# Gemini API Swift SDK sample code | ||
|
||
This directory contains sample code for key features of the SDK, organised by high level feature. | ||
|
||
These samples are embedded in parts of the [documentation](https://ai.google.dev), most notably in the [API reference](https://ai.google.dev/api). | ||
|
||
Each file is structured as a runnable test case, ensuring that samples are executable and functional. Each test demonstrates a single concept, and contains region tags that are used to demarcate the test scaffolding from the spotlight code. If you are contributing, code within region tags should follow sample code best practices - being clear, complete and concise. | ||
|
||
## Contents | ||
|
||
| File | Description | | ||
| ---- | ----------- | | ||
| [APIKey.swift](./APIKey.swift) | Setting up your API key | | ||
| [ChatSnippets.swift](./ChatSnippets.swift) | Multi-turn chat conversations | | ||
| [CodeExecution.swift](./CodeExecution.swift) | Executing code | | ||
| [ControlledGeneration.swift](./ControlledGeneration.swift) | Generating content with output constraints (e.g. JSON mode) | | ||
| [CountTokens.swift](./CountTokens.swift) | Counting input and output tokens | | ||
| [FunctionCalling.swift](./FunctionCalling.swift) | Using function calling | | ||
| [GenerationConfig.swift](./GenerationConfig.swift) | Setting model parameters | | ||
| [SafetySettings.swift](./SafetySettings.swift) | Setting and using safety controls | | ||
| [SystemInstructions.swift](./SystemInstructions.swift) | Setting system instructions | | ||
| [TextGeneration.swift](./TextGeneration.swift) | Generating text | |