diff --git a/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/feature/chat/ChatScreen.kt b/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/feature/chat/ChatScreen.kt index 87c2257..5e98896 100644 --- a/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/feature/chat/ChatScreen.kt +++ b/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/feature/chat/ChatScreen.kt @@ -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") +}