androidengineers.Book a session

Gemini, instructions, and context

What the Gemini API provides

articleSelf-paced

What changes when you send a message?

Gemini is already pretrained. PocketChat does not train it when you type, save an answer, or edit the assistant's description. Each GenerateContent request supplies instructions and selected conversation text. The model generates a response from that input and its learned capabilities. This distinction explains why an answer may mention training knowledge rather than current events.

Read AndroidEngineersGuide.kt, Models.kt, and GeminiChatService.kt. Three separate layers meet at the request boundary:

LayerSourcePurpose
System instructionCurated app codeIdentity, answer style, organization directory, and limitations
Completed conversation pairsLocal app stateRelevant facts from this conversation
Latest questionEditable user draftThe task the learner wants help with

A system instruction influences generated language; it is not authorization or a guarantee. The app separately controls which resource buttons it renders and which actions actually exist.

Follow the context representation

data class ChatPart(val role: String, val text: String)
data class ContextWindow(val parts: List<ChatPart>, val omitted: Boolean)

Roles preserve the difference between a user question and a model answer. Concatenating everything into one unstructured string would make the boundary harder to inspect. The sample sends completed pairs plus the new question; failed and stopped output is not silently accepted as conversation knowledge.

What the branded guide knows

The directory names four public destinations: roadmaps, codelabs, courses, and 1:1 mentorship. It does not contain course transcripts, private account data, current booking slots, or a search index. Saving a note does not make it searchable by Gemini. Google Search and tool execution are not connected.

Try “What can you help me learn?” and then “Can you book a session tomorrow?” The first may produce a useful resource suggestion. The second should explain the limitation and point to the website. A prompt asking it to ignore those limits is an evaluation input, not a permission change.

Check your understanding

If the assistant says a course costs a particular amount, did the app verify that price? No. Neither the directory nor a live price lookup provides that evidence. The correct behavior is to refer to the current website and avoid unsupported promises.

Read the official request fields alongside the actual adapter. A model's general API capabilities are broader than the subset this app implements.

Study guide · Hands-on codelab · Pinned Android source

YOUR LEARNING JOURNEY

0 of 23 available lessons completed

Progress saved in this browser. No account needed.
What the Gemini API provides | Gemini Chat for Android with PocketChat | Android Engineers