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

    Expanded billing choice and lower fees on Google Play

    Posted by Paul Feng, Vice President, Google Play Eng, Product, UX At Google Play, we are committed to delivering the best possible experience to users, while ensuring developers have the…

    Building a safer ecosystem together

    Posted by Matthew Forsythe, Director Product Management, Android App Safety Last year, we introduced Android developer verification to strengthen ecosystem security and stop malicious actors from hiding behind anonymity to…

    Leave a Reply

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