Skip to content

Commit

Permalink
Update samples/src/main/java/com/google/ai/client/generative/samples/…
Browse files Browse the repository at this point in the history
…function_calling.kt

Co-authored-by: Daymon <[email protected]>
  • Loading branch information
rlazo and daymxn authored Jul 12, 2024
1 parent ef62034 commit 9156c8b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,16 @@ suspend fun functionCalling() {
)
)

val usableFunctions = listOf(multiplyDefinition)

val generativeModel =
GenerativeModel(
// Specify a Gemini model appropriate for your use case
modelName = "gemini-1.5-flash",
// Access your API key as a Build Configuration variable (see "Set up your API key" above)
apiKey = BuildConfig.apiKey,
// List the functions definitions you want to make available to the model
tools = listOf(Tool(listOf(multiplyDefinition)))
tools = listOf(Tool(usableFunctions))
)

val chat = generativeModel.startChat()
Expand Down

0 comments on commit 9156c8b

Please sign in to comment.