Commit 1459ffc9 authored by Jeffrey Morgan's avatar Jeffrey Morgan
Browse files

desktop: fix response parsing

parent 01d2667f
......@@ -39,7 +39,8 @@ async function generate(prompt: string, model: string, callback: (res: string) =
let decoder = new TextDecoder()
let str = decoder.decode(value)
let re = /}{/g
let re = /}\s*{/g
str = '[' + str.replace(re, '},{') + ']'
let messages = JSON.parse(str)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment