Skip to content
Merged
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
16 changes: 8 additions & 8 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,27 +144,27 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build app module (debug)
- name: Build app module (release)
if: env.BUILD_APP == 'true'
run: ./gradlew :app:assembleDebug
run: ./gradlew :app:assembleRelease

- name: Build humanoperator module (debug)
- name: Build humanoperator module (release)
if: env.BUILD_HUMANOPERATOR == 'true'
run: ./gradlew :humanoperator:assembleDebug
run: ./gradlew :humanoperator:assembleRelease

- name: Upload app APK
if: env.BUILD_APP == 'true'
uses: actions/upload-artifact@v4
with:
name: app-debug
path: app/build/outputs/apk/debug/app-debug.apk
name: app-release-unsigned
path: app/build/outputs/apk/release/app-release-unsigned.apk

- name: Upload humanoperator APK
if: env.BUILD_HUMANOPERATOR == 'true'
uses: actions/upload-artifact@v4
with:
name: humanoperator-debug
path: humanoperator/build/outputs/apk/debug/humanoperator-debug.apk
name: humanoperator-release-unsigned
path: humanoperator/build/outputs/apk/release/humanoperator-release-unsigned.apk

- name: Build summary
run: |
Expand Down
7 changes: 7 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,15 @@ android {
}

buildTypes {
getByName("debug") {
isDebuggable = true
}
getByName("release") {
isDebuggable = false
}
create("samples") {
initWith(getByName("debug"))
isDebuggable = false
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ enum class ModelOption(
val additionalDownloadUrls: List<String> = emptyList(),
val requiresVisionBackend: Boolean = false
) {
PUTER_GPT_5_4_NANO("GPT-5.4 Nano (Puter)", "openai/gpt-5.4-nano", ApiProvider.PUTER, supportsScreenshot = true),
PUTER_GLM5("GLM-5V Turbo (Puter)", "openrouter:z-ai/glm-5v-turbo", ApiProvider.PUTER, supportsScreenshot = true),
MISTRAL_LARGE_3("Mistral Large 3", "mistral-large-latest", ApiProvider.MISTRAL),
MISTRAL_MEDIUM_3_1("Mistral Medium 3.1", "mistral-medium-latest", ApiProvider.MISTRAL),
Expand Down
8 changes: 6 additions & 2 deletions app/src/main/kotlin/com/google/ai/sample/MenuScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,14 @@ fun MenuScreen(
}
val normalModels = allModels.filter {
it != ModelOption.MISTRAL_MEDIUM_3_1 &&
it != ModelOption.PUTER_GPT_5_4_NANO &&
it.apiProvider != ApiProvider.VERCEL &&
!STRIKETHROUGH_MODELS.contains(it)
}
val orderedModels = listOf(ModelOption.MISTRAL_MEDIUM_3_1) +
val orderedModels = listOf(
ModelOption.PUTER_GPT_5_4_NANO,
ModelOption.MISTRAL_MEDIUM_3_1
) +
normalModels +
vercelModels +
STRIKETHROUGH_MODELS
Expand Down Expand Up @@ -288,7 +292,7 @@ fun MenuScreen(
ModelOption.GPT_OSS_120B -> "This is a pure text model\nCerebras sometimes discontinues free access in the Free Tier, displaying an \"Error 404: gpt-oss-120b does not exist or you do not have access to it\" message, or changes the rate limits."
ModelOption.MISTRAL_LARGE_3 -> "Mistral AI rejects requests containing non-black images with a 429 Error: Rate limit exceeded response"
ModelOption.GEMINI_3_FLASH -> "Google often rejects requests to this model with a 503 Model is exhausted error"
ModelOption.PUTER_GLM5 -> "This model is expensive and uses up the free quota quickly. Consider GPT 5.4 nano"
ModelOption.PUTER_GLM5 -> "This model is expensive and uses up the free quota quickly. Consider GPT-5.4 Nano."
ModelOption.GPT_5_1_CODEX_MAX,
ModelOption.GPT_5_1_CODEX_MINI,
ModelOption.GPT_5_NANO -> "Vercel requires a credit card"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ class PhotoReasoningViewModel(

// Keep track of the current user input
private var currentUserInput: String = ""
private var latestUserTaskInput: String = ""

// Observable state for the input field to persist across configuration changes
private val _userInput = MutableStateFlow("")
Expand Down Expand Up @@ -791,10 +790,6 @@ class PhotoReasoningViewModel(
imageUrisForChat: List<String>? = null
) {
val currentModel = com.google.ai.sample.GenerativeAiViewModelFactory.getCurrentModel()
if (userInput.isNotBlank() && screenInfoForPrompt.isNullOrBlank()) {
latestUserTaskInput = userInput.trim()
}

clearStaleErrorState()
stopExecutionFlag.set(false)

Expand Down Expand Up @@ -1191,7 +1186,8 @@ class PhotoReasoningViewModel(
}

// CerebrasRequest braucht stream-Feld — inline als JSON-String um Datenklasse nicht zu ändern
val streamingBody = """{"model":"$modelName","messages":${Json.encodeToString(apiMessages)},"max_completion_tokens":1024,"temperature":0.2,"top_p":1.0,"stream":true}"""
val selectedModelName = com.google.ai.sample.GenerativeAiViewModelFactory.getCurrentModel().modelName
val streamingBody = """{"model":"$selectedModelName","messages":${Json.encodeToString(apiMessages)},"max_completion_tokens":1024,"temperature":0.2,"top_p":1.0,"stream":true}"""
val mediaType = "application/json".toMediaType()
val client = OkHttpClient()

Expand Down Expand Up @@ -1859,7 +1855,7 @@ class PhotoReasoningViewModel(
context = context,
inputContentJson = inputContentJson,
chatHistoryJson = chatHistoryJson,
modelName = generativeModel.modelName,
modelName = currentModel.modelName,
apiKey = apiKey,
apiProvider = currentModel.apiProvider,
tempFilePaths = tempFilePaths
Expand Down Expand Up @@ -2166,32 +2162,6 @@ class PhotoReasoningViewModel(
}

private fun createGenericScreenshotPrompt(): String {
val latestTask = latestUserTaskInput.trim()
if (latestTask.isNotBlank()) {
return latestTask
}

val lastUserMessage = _chatState.getAllMessages()
.asReversed()
.firstOrNull { it.participant == PhotoParticipant.USER && it.text.isNotBlank() }
?.text
?.trim()

if (!lastUserMessage.isNullOrBlank()) {
val screenInfoMarker = "\n\nScreen elements:\n"
return lastUserMessage.substringBefore(screenInfoMarker).trim()
}

val persistedInput = _userInput.value.trim()
if (persistedInput.isNotBlank()) {
return persistedInput
}

val lastKnownInput = currentUserInput.trim()
if (lastKnownInput.isNotBlank()) {
return lastKnownInput
}

return ""
}

Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/xml/data_extraction_rules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@
<data-extraction-rules>
<cloud-backup>
<include domain="sharedpref" path="."/>
<exclude domain="file" path="no_backup/"/>
<exclude domain="database" path="."/>
</cloud-backup>
<device-transfer>
<include domain="sharedpref" path="."/>
<exclude domain="file" path="no_backup/"/>
<exclude domain="database" path="."/>
</device-transfer>
</data-extraction-rules>
Loading