Open GuillaumeTurcotte opened 1 month ago
This bit of code from api.ts doesn't work on Safari (on mac os):
api.ts
try { while (true) { const { done, value } = await reader.read(); if (done) break; partialData += decoder.decode(value, { stream: true }); const result = contentRegex.exec(partialData); if(result && result[1]) { const content = result[1].trim(); updateLastMessage(content); } } //finished reading the stream, let's load the json object properly this time and populate the rest of the answer. const json = jsonRegex.exec(partialData); if(json && json[1]){ completion = JSON.parse(json[1]); } if (!completion) { throw new Error('Failed to obtain completion from the server response.'); } } catch (error) { console.error('Error while reading the stream:', error); throw error; } finally { reader.releaseLock(); } return completion; }
TDB; this might have to do with headers sent (badly formatted ones).
This bit of code from
api.ts
doesn't work on Safari (on mac os):success criteria