Unlock Custom On-Device Gemini Nano Experiences


Prompt API lets you create custom prompts and set optional generation parameters with just a few lines of code:

Generation.getClient().generateContent(
   generateContentRequest(
       ImagePart(bitmapImage),
       TextPart("Categorize this image as one of the following: car, motorcycle, bike, scooter, other. Return only the category as the response."),
   ) {
       // Optional parameters
       temperature = 0.2f
       topK = 10
       candidateCount = 1
       maxOutputTokens = 10
   },
)

For more detailed examples of implementing Prompt API, check out the official documentation and sample on Github.


Gemini Nano, performance, and prototyping


Prompt API currently performs best on the Pixel 10 device series, which runs the latest version of Gemini Nano (nano-v3). This version of Gemini Nano is built on the same architecture as Gemma 3n, the model we first shared with the open model community at I/O.


The shared foundation between Gemma 3n and nano-v3 enables developers to more easily prototype features. For those without a Pixel 10 device, you can start experimenting with prompts today by prototyping with Gemma 3n locally or accessing it online through Google AI Studio.


For the full list of devices that support GenAI APIs, refer to our device support documentation.


Learn more

Start implementing Prompt API in your Android apps today with guidance from our official documentation and the sample on Github.



Source link

  • Related Posts

    Test Multi-Device Interactions with the Android Emulator

    Posted by Steven Jenkins, Product Manager, Android Studio Testing multi-device interactions is now easier than ever with the Android Emulator. Whether you are building a multiplayer game, extending your mobile…

    our most capable local model for agentic coding

    Posted by Matthew Warner, Google Product Manager Every developer’s AI workflow and needs are unique, and it’s important to be able to choose how AI helps your development. In January,…

    Leave a Reply

    Your email address will not be published. Required fields are marked *