This commit is contained in:
yumoqing 2026-04-10 18:02:47 +08:00
parent 8f0a50c803
commit 515dc3f63f

View File

@ -23,10 +23,12 @@ async def append_new_llmoutput(webpath, output):
critical(f'{webpath=}')
bin = await read_webpath(webpath)
io = json.loads(bin.decode('utf-8'))
debug(f'append_new_llmoutput({webpath=}, {output=}')
io['output'].append(output)
async with aiofiles.open(p, 'wb') as f:
iostr = json.dumps(io, ensure_ascii=False, indent=4)
f.write(iostr.encode('utf-8'))
debug(f'append_new_llmoutput({webpath=}, {output=}')
await f.write(iostr.encode('utf-8'))
async def get_lastoutput(webpath):
bin = await read_webpath(webpath)