fix: parser error for empty json buffer

This commit is contained in:
KernelDeimos committed 2025-02-04 15:42:03 -05:00
1 parent d2358d234b
commit 484bb5c201
1 file changed
+3
@@ -46,6 +46,9 @@ class AIChatToolUseStream extends AIChatConstructStream {
this.buffer += partial_json;
}
_end () {
if ( this.buffer.trim() === '' ) {
this.buffer = '{}';
}
const str = JSON.stringify(objectAssignTop({
...this.contentBlock,
input: JSON.parse(this.buffer),