Add structured output detection helper
This commit is contained in:
1 parent
c7ed167760
commit
d9582d9b86
1 file changed
+10
@@ -388,3 +388,13 @@ private fun MessageBubble(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun looksStructuredOutput(text: String): Boolean {
|
||||
val trimmed = text.trim()
|
||||
if (trimmed.isEmpty()) return false
|
||||
if ((trimmed.startsWith("{") && trimmed.endsWith("}")) || (trimmed.startsWith("[") && trimmed.endsWith("]"))) {
|
||||
return true
|
||||
}
|
||||
val lineCount = trimmed.lines().size
|
||||
return lineCount >= 4 || trimmed.contains("\n ") || trimmed.contains("\t")
|
||||
}
|
||||
Reference in new issue
Block a user