expo-ai-kit 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -85,11 +85,13 @@ class ExpoAiKitModule : Module() {
|
|
|
85
85
|
|
|
86
86
|
// Launch streaming in a coroutine that can be cancelled
|
|
87
87
|
val job = streamScope.launch {
|
|
88
|
-
val
|
|
88
|
+
val streamAccumulator = StringBuilder()
|
|
89
|
+
val streamCallback = { token: String, _: String, isDone: Boolean ->
|
|
90
|
+
streamAccumulator.append(token)
|
|
89
91
|
sendEvent("onStreamToken", mapOf(
|
|
90
92
|
"sessionId" to sessionId,
|
|
91
93
|
"token" to token,
|
|
92
|
-
"accumulatedText" to
|
|
94
|
+
"accumulatedText" to streamAccumulator.toString(),
|
|
93
95
|
"isDone" to isDone
|
|
94
96
|
))
|
|
95
97
|
|
package/package.json
CHANGED