To help you get the most accurate and context-aware answers for your Google Home platform projects, we have released an AI Knowledge Base file.
This file (google-home-api-knowledge-base.txt) is a curated "source of truth"
document containing detailed API specifications and code examples. When you
provide this file to a Large Language Model (LLM), it acts as a powerful "cheat
sheet," allowing the AI to answer your specific Home APIs questions with
greater precision.
We highly recommend using this with Gemini in Android Studio, but you can also use it with other LLMs (like Gemini on the web) by providing the file as context.
Prerequisites
- Android Studio: You must have Android Studio Narwhal (2024.2.1) or newer.
- Gemini Plugin: You must have the Gemini in Android Studio plugin installed and enabled.
Step-by-step instructions
Get the Knowledge Base file
The knowledge base file is available on our official Google Home sample app repository on GitHub. You can either:
- Clone the entire sample app repository, or
- Download just the
google-home-api-knowledge-base.txtfile directly from the repository.
Add the file to Your project
If you did not clone the repository, place the
google-home-api-knowledge-base.txtfile anywhere inside your project. We recommend putting it in the/toolsfolder.
Where to place the file in the project. Attach the file in Gemini Chat
Open the Gemini chat pane in Android Studio. To give Gemini the file's context, type the @ symbol. An autocomplete menu will pop up, showing available files. Select
google-home-api-knowledge-base.txtfrom the list.For more information, see Attach a file to your query in Gemini in Android Studio.
How to add context to Gemini. Ask your question
With the file attached, you can now ask your detailed question. Gemini will now use the knowledge base to provide a detailed, accurate answer based on your file.