Skip to content

Commit

Permalink
Add comment block for api key
Browse files Browse the repository at this point in the history
  • Loading branch information
rlazo committed Jun 26, 2024
1 parent 979352d commit 75317e9
Show file tree
Hide file tree
Showing 16 changed files with 115 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ import com.google.ai.client.generativeai.GenerativeModel
import com.google.ai.client.generativeai.type.content
import com.google.ai.sample.R

// Set up your API Key
// ====================
//
// To use the Gemini API, you'll need an API key. To learn more, see
// the "Set up your API Key section" in the [Gemini API
// quickstart](https://ai.google.dev/gemini-api/docs/quickstart?lang=android#set-up-api-key).

suspend fun chat() {
// [START chat]
val generativeModel =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,11 @@

package com.google.ai.client.generative.samples

// Set up your API Key
// ====================
//
// To use the Gemini API, you'll need an API key. To learn more, see
// the "Set up your API Key section" in the [Gemini API
// quickstart](https://ai.google.dev/gemini-api/docs/quickstart?lang=android#set-up-api-key).

// TODO
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ import com.google.ai.client.generativeai.GenerativeModel
import com.google.ai.client.generativeai.type.content
import com.google.ai.sample.R

// Set up your API Key
// ====================
//
// To use the Gemini API, you'll need an API key. To learn more, see
// the "Set up your API Key section" in the [Gemini API
// quickstart](https://ai.google.dev/gemini-api/docs/quickstart?lang=android#set-up-api-key).

suspend fun tokensTextOnly() {
// [START tokens_text_only]
val generativeModel =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,12 @@

package com.google.ai.client.generative.samples


// Set up your API Key
// ====================
//
// To use the Gemini API, you'll need an API key. To learn more, see
// the "Set up your API Key section" in the [Gemini API
// quickstart](https://ai.google.dev/gemini-api/docs/quickstart?lang=android#set-up-api-key).

// TODO
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;

// Set up your API Key
// ====================
//
// To use the Gemini API, you'll need an API key. To learn more, see
// the "Set up your API Key section" in the [Gemini API
// quickstart](https://ai.google.dev/gemini-api/docs/quickstart?lang=android#set-up-api-key).

class Chat {
void chat() {
// [START chat]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@

package com.google.ai.client.generative.samples.java;

// Set up your API Key
// ====================
//
// To use the Gemini API, you'll need an API key. To learn more, see
// the "Set up your API Key section" in the [Gemini API
// quickstart](https://ai.google.dev/gemini-api/docs/quickstart?lang=android#set-up-api-key).

class ControlledGeneration {
// TODO
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

// Set up your API Key
// ====================
//
// To use the Gemini API, you'll need an API key. To learn more, see
// the "Set up your API Key section" in the [Gemini API
// quickstart](https://ai.google.dev/gemini-api/docs/quickstart?lang=android#set-up-api-key).

class CountTokens {
void tokensTextOnly() {
// [START tokens_text_only]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@

package com.google.ai.client.generative.samples.java;

// Set up your API Key
// ====================
//
// To use the Gemini API, you'll need an API key. To learn more, see
// the "Set up your API Key section" in the [Gemini API
// quickstart](https://ai.google.dev/gemini-api/docs/quickstart?lang=android#set-up-api-key).

class FunctionCalling {
// TODO
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
import com.google.ai.client.generativeai.type.GenerationConfig;
import java.util.Arrays;

// Set up your API Key
// ====================
//
// To use the Gemini API, you'll need an API key. To learn more, see
// the "Set up your API Key section" in the [Gemini API
// quickstart](https://ai.google.dev/gemini-api/docs/quickstart?lang=android#set-up-api-key).

class ConfigureModel {
void configureModel() {
// [START configure_model]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
import java.util.Arrays;
import java.util.Collections;

// Set up your API Key
// ====================
//
// To use the Gemini API, you'll need an API key. To learn more, see
// the "Set up your API Key section" in the [Gemini API
// quickstart](https://ai.google.dev/gemini-api/docs/quickstart?lang=android#set-up-api-key).

class SafetySettings {
void safetySettings() {
// [START safety_settings]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
import com.google.ai.client.generativeai.type.Content;
import com.google.ai.client.generativeai.type.RequestOptions;

// Set up your API Key
// ====================
//
// To use the Gemini API, you'll need an API key. To learn more, see
// the "Set up your API Key section" in the [Gemini API
// quickstart](https://ai.google.dev/gemini-api/docs/quickstart?lang=android#set-up-api-key).

class SystemInstruction {
void systemInstruction() {
// [START system_instruction]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;

// Set up your API Key
// ====================
//
// To use the Gemini API, you'll need an API key. To learn more, see
// the "Set up your API Key section" in the [Gemini API
// quickstart](https://ai.google.dev/gemini-api/docs/quickstart?lang=android#set-up-api-key).

class TextGeneration {
void TextGenTextOnlyPrompt() {
// [START text_gen_text_only_prompt]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ package com.google.ai.client.generative.samples
import com.google.ai.client.generativeai.GenerativeModel
import com.google.ai.client.generativeai.type.generationConfig

// Set up your API Key
// ====================
//
// To use the Gemini API, you'll need an API key. To learn more, see
// the "Set up your API Key section" in the [Gemini API
// quickstart](https://ai.google.dev/gemini-api/docs/quickstart?lang=android#set-up-api-key).


suspend fun configureModel() {
// [START configure_model]
val config = generationConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ import com.google.ai.client.generativeai.type.BlockThreshold
import com.google.ai.client.generativeai.type.HarmCategory
import com.google.ai.client.generativeai.type.SafetySetting

// Set up your API Key
// ====================
//
// To use the Gemini API, you'll need an API key. To learn more, see
// the "Set up your API Key section" in the [Gemini API
// quickstart](https://ai.google.dev/gemini-api/docs/quickstart?lang=android#set-up-api-key).


suspend fun safetySettings() {
// [START safety_settings]
val generativeModel =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ package com.google.ai.client.generative.samples
import com.google.ai.client.generativeai.GenerativeModel
import com.google.ai.client.generativeai.type.content

// Set up your API Key
// ====================
//
// To use the Gemini API, you'll need an API key. To learn more, see
// the "Set up your API Key section" in the [Gemini API
// quickstart](https://ai.google.dev/gemini-api/docs/quickstart?lang=android#set-up-api-key).

suspend fun systemInstruction() {
// [START system_instruction]
val generativeModel =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ package com.google.ai.client.generative.samples
import com.google.ai.client.generativeai.GenerativeModel
import com.google.ai.client.generativeai.type.content

// Set up your API Key
// ====================
//
// To use the Gemini API, you'll need an API key. To learn more, see
// the "Set up your API Key section" in the [Gemini API
// quickstart](https://ai.google.dev/gemini-api/docs/quickstart?lang=android#set-up-api-key).

suspend fun textGenTextOnlyPrompt() {
// [START text_gen_text_only_prompt]
val generativeModel =
Expand Down

0 comments on commit 75317e9

Please sign in to comment.