Skip to content

Commit

Permalink
Use singular, system instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
rlazo committed Jun 26, 2024
1 parent 687bed9 commit 979352d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@
import com.google.ai.client.generativeai.type.Content;
import com.google.ai.client.generativeai.type.RequestOptions;

class SystemInstructions {
void systemInstructions() {
// [START system_instructions]
class SystemInstruction {
void systemInstruction() {
// [START system_instruction]
GenerativeModel model =
new GenerativeModel(
// Specify a Gemini model appropriate for your use case
// Specify a Gemini model appropriate for your use case
/* modelName */ "gemini-1.5-flash",
/* apiKey */ BuildConfig.apiKey,
Expand All @@ -35,6 +34,6 @@ void systemInstructions() {
/* systemInstruction (optional) */ new Content.Builder()
.addText("You are a cat. Your name is Neko.")
.build());
// [END system_instructions]
// [END system_instruction]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ package com.google.ai.client.generative.samples
import com.google.ai.client.generativeai.GenerativeModel
import com.google.ai.client.generativeai.type.content

suspend fun systemInstructions() {
// [START system_instructions]
suspend fun systemInstruction() {
// [START system_instruction]
val generativeModel =
GenerativeModel(
// Specify a Gemini model appropriate for your use case
modelName = "gemini-1.5-flash",
apiKey = BuildConfig.apiKey,
systemInstruction = content { text("You are a cat. Your name is Neko.") },
)
// [END system_instructions]
// [END system_instruction]
}

0 comments on commit 979352d

Please sign in to comment.