Skip to content

Commit 90c4c66

Browse files
committed
Fixed prompt to alpha, removed entropyt values
1 parent c91e832 commit 90c4c66

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

app/src/main/java/org/openinsectid/app/ui/components/AlphaLLMAnswerBox.kt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private fun parseAlphaResponse(raw: String): String {
9494
fun AlphaQueryAnswer(
9595
alphaLLMApiKey: String,
9696
alphaLLMApiUrl: String,
97-
predictions: Map<String, Pair<String, Float>>?,
97+
insectName: String?,
9898
modifier: Modifier = Modifier
9999
) {
100100
var queryText by remember { mutableStateOf("") }
@@ -130,10 +130,9 @@ fun AlphaQueryAnswer(
130130
val ctx = LocalContext.current
131131

132132
// Auto-generate query from predictions and auto-query when predictions change
133-
LaunchedEffect(predictions) {
134-
predictions?.takeIf { it.isNotEmpty() }?.let { infos ->
135-
val insectName = infos.values.joinToString(" ")
136-
queryText = "Write a short description of this insect: $insectName: characteristics, habitat, and interesting facts"
133+
LaunchedEffect(insectName) {
134+
insectName?.takeIf { it.isNotEmpty() }?.let { name ->
135+
queryText = "Write a short description of this insect: $name: characteristics, habitat, and interesting facts"
137136

138137
// Auto-launch query
139138
isLoading = true
@@ -170,10 +169,9 @@ fun AlphaQueryAnswer(
170169

171170

172171
fun resetQuery() {
173-
predictions?.takeIf { it.isNotEmpty() }?.let { infos ->
174-
val insectName = infos.values.joinToString(" ")
172+
insectName?.takeIf { it.isNotEmpty() }?.let { name ->
175173
queryText =
176-
"Write a short description of this insect: $insectName: characteristics, habitat, and interesting facts"
174+
"Write a short description of this insect: $name: characteristics, habitat, and interesting facts"
177175
}
178176
}
179177

app/src/main/java/org/openinsectid/app/ui/screens/MainScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ fun MainScreen(navController: NavController) {
288288
AlphaQueryAnswer(
289289
alphaLLMApiKey = alphaLLMApiKey,
290290
alphaLLMApiUrl = alphaLLMApiUrl,
291-
predictions = predictions
291+
insectName = insectName
292292
)
293293

294294
ImageSearch(

0 commit comments

Comments
 (0)