mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-29 12:50:59 +00:00
dev: add additional debugging for stream AI errors
This commit is contained in:
@@ -598,6 +598,9 @@ class AIChatService extends BaseService {
|
||||
try {
|
||||
await ret.result.value.init_chat_stream({ chatStream });
|
||||
} catch (e) {
|
||||
this.errors.report('error during stream response', {
|
||||
source: e,
|
||||
})
|
||||
stream.write(JSON.stringify({
|
||||
type: 'error',
|
||||
message: e.message,
|
||||
|
||||
@@ -49,6 +49,7 @@ class AIChatToolUseStream extends AIChatConstructStream {
|
||||
if ( this.buffer.trim() === '' ) {
|
||||
this.buffer = '{}';
|
||||
}
|
||||
if ( process.env.DEBUG ) console.log('BUFFER BEING PARSED', this.buffer);
|
||||
const str = JSON.stringify(objectAssignTop({
|
||||
...this.contentBlock,
|
||||
input: JSON.parse(this.buffer),
|
||||
|
||||
Reference in New Issue
Block a user