mirror of
https://github.com/HeyPuter/puter.git
synced 2026-10-07 04:12:36 +00:00
fix: parser error for empty json buffer
This commit is contained in:
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),
|
||||
|
||||
Reference in new issue
Block a user