ispbills-icli 8.4.0 → 8.4.1
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.
- package/package.json +1 -1
- package/src/client.js +5 -1
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -153,6 +153,10 @@ export async function streamChat(cfg, messages, options = {}) {
|
|
|
153
153
|
|
|
154
154
|
const reply = finalResult?.reply ?? {};
|
|
155
155
|
const meta = finalResult?._meta ?? {};
|
|
156
|
-
|
|
156
|
+
// Prefer whichever is longer: the final parsed reply.text or the text we
|
|
157
|
+
// streamed live. Guards against any server-side cap silently shortening the
|
|
158
|
+
// committed answer below what the operator already saw stream by.
|
|
159
|
+
const finalText = reply.text || '';
|
|
160
|
+
const text = finalText.length >= answerText.length ? finalText : answerText;
|
|
157
161
|
return { reply, text, meta };
|
|
158
162
|
}
|