Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ com_crashlytics_export_strings.xml

.idea/android_sdk/
android_sdk/
*.idsig
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Agent Instructions

After each successfully executed programming instruction, the app must be built and submitted in the following way:
Do not perform any pre-commit steps except request code review and record learning content. After successful programming, the app must be built and submitted in the following way:

If you are not Jules, or if the Android SDK is not already installed, then you will need to install it first:
If you are not Jules, then you will need to install the Android SDK first:

```
#!/bin/bash
Expand Down
Binary file removed app-release-signed.apk
Binary file not shown.
Binary file removed app-release-signed.apk.idsig
Binary file not shown.
15 changes: 7 additions & 8 deletions app/src/main/kotlin/com/google/ai/sample/MenuScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,13 @@ fun MenuScreen(
.padding(horizontal = 16.dp, vertical = 8.dp)
) {
val annotatedText = buildAnnotatedString {
append("• Preview models could be deactivated by Google without being handed over to the final release.\\n")
append("• GPT-oss 120b is a pure text model.\\n")
append("• Gemma 3n E4B it cannot handle screenshots in the API.\\n")
append("• GPT models (Vercel) have a free budget of $5 per month.\\n")
append("GPT-5.1 Input: $1.25/M Output: $10.00/M\\n")
append("GPT-5.1 mini Input: $0.25/ M Output: $2.00/M\\n")
append("GPT-5 nano Input: $0.05/M Output: $0.40/M\\n")
append("• Preview models could be deactivated by Google without being handed over to the final release.\n")
append("• GPT-oss 120b is a pure text model.\n")
append("• Gemma 3n E4B it cannot handle screenshots in the API.\n")
append("• GPT models (Vercel) have a free budget of $5 per month.\n")
append("GPT-5.1 Input: $1.25/M Output: $10.00/M\n")
append("GPT-5.1 mini Input: $0.25/ M Output: $2.00/M\n")
append("GPT-5 nano Input: $0.05/M Output: $0.40/M\n")
append("• There are rate limits for free use of Gemini models. The less powerful the models are, the more you can use them. The limits range from a maximum of 5 to 30 calls per minute. After each screenshot (every 2-3 seconds) the LLM must respond again. More information is available at ")

pushStringAnnotation(tag = "URL", annotation = "https://ai.google.dev/gemini-api/docs/rate-limits")
Expand Down Expand Up @@ -372,4 +372,3 @@ fun MenuScreenTrialExpiredPreview() {
// Preview with trial expired
MenuScreen(innerPadding = PaddingValues(), isTrialExpired = true, isPurchased = false)
}

10 changes: 5 additions & 5 deletions app/src/main/kotlin/com/google/ai/sample/ScreenCaptureService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -734,11 +734,11 @@ sealed class VercelContent

@Serializable
@SerialName("text")
data class VercelTextContent(val text: String) : VercelContent()
data class VercelTextContent(@SerialName("text") val content: String) : VercelContent()

@Serializable
@SerialName("image_url")
data class VercelImageContent(val image_url: VercelImageUrl) : VercelContent()
data class VercelImageContent(@SerialName("image_url") val content: VercelImageUrl) : VercelContent()

@Serializable
data class VercelImageUrl(val url: String)
Expand Down Expand Up @@ -767,9 +767,9 @@ private suspend fun callVercelApi(modelName: String, apiKey: String, chatHistory
val messages = (chatHistory + inputContent).map { content ->
val parts = content.parts.map { part ->
when (part) {
is TextPart -> VercelTextContent(text = part.text)
is ImagePart -> VercelImageContent(image_url = VercelImageUrl(url = part.image.toBase64()))
else -> VercelTextContent(text = "") // Or handle other part types appropriately
is TextPart -> VercelTextContent(content = part.text)
is ImagePart -> VercelImageContent(content = VercelImageUrl(url = part.image.toBase64()))
else -> VercelTextContent(content = "") // Or handle other part types appropriately
}
}
VercelMessage(role = if (content.role == "user") "user" else "assistant", content = parts)
Expand Down
2 changes: 1 addition & 1 deletion build_and_sign.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fi
# 2. Download and unzip the Android SDK command-line tools
echo "INFO: Downloading Android SDK..."
wget -q https://dl.google.com/android/repository/commandlinetools-linux-13114758_latest.zip
unzip -q commandlinetools-linux-13114758_latest.zip -d android_sdk
unzip -oq commandlinetools-linux-13114758_latest.zip -d android_sdk
rm commandlinetools-linux-13114758_latest.zip

# 3. Restructure cmdline-tools for sdkmanager
Expand Down