ml-kit-genai-prompt-api
Installation
SKILL.md
This skill provides step-by-step guidance for integrating and optimizing the ML Kit GenAI Prompt API in Android apps.
Prerequisites
- Android API level must be 26 or higher. If
minSdkis below 26, update it to 26. - Add the ML Kit GenAI Prompt API dependency (
com.google.mlkit:genai-prompt) to the app-levelbuild.gradlefile, with version at least1.0.0-beta4. - If
com.google.mlkit:genai-schema-compilerdependency is used and KSP plugin version is below 2.3.6, update it to 2.3.6.
Detailed steps
1. Prompt optimization
To optimize prompts for use with the ML Kit Prompt API, follow the prompt optimization guide.
2. Prefix caching optimization
If the prompt is more than 200 words, implement the prefix caching API.