Skip to content

Files

Latest commit

 

History

History

samples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Gemini API Android 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, most notably in the API reference.

Contents

Kotlin Java Description
chat.kt chat.java Multi-turn chat conversations
code_execution.kt code_execution.java Executing code
configure_model_parameters.kt configure_model_parameters.java Setting model parameters
controlled_generation.kt controlled_generation.java Generating content with output constraints (e.g. JSON mode)
count_tokens.kt count_tokens.java Counting input and output tokens
function_calling.kt function_calling.java Using function calling
safety_settings.kt safety_settings.java Setting and using safety controls
system_instruction.kt system_instruction.java Setting system instructions
text_generation.kt text_generation.java Generating text