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

    How WhatsApp Upgraded to Secure, Seamless Sign-In for 1 Billion Users with Passkeys

    Posted by Niharika Arora, Senior Developer Relations Engineer, Tracy Agyemang, Product Marketing Manager, Google and  Mayank Manuja, Android Engineer, Meta WhatsApp is the world’s largest messaging platform, serving billions of…

    Reducing memory usage and improving device migration

    Posted by Raghavendra Hareesh Pottamsetty, GM, Google Play Developer & Monetization Maintaining a healthy Android ecosystem is a shared commitment where every app and game has a role to play.…

    Leave a Reply

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