This commit is contained in:
yumoqing 2024-08-03 18:22:53 +08:00
parent f8dc17f12f
commit 8603274074
2 changed files with 4 additions and 1 deletions

View File

@ -1,3 +1,4 @@
from appPublic.log import info, debug, warning, error, exception, critical
from ahserver.serverenv import ServerEnv from ahserver.serverenv import ServerEnv
from aiohttp.web import StreamResponse from aiohttp.web import StreamResponse
@ -12,6 +13,7 @@ async def generate(request, **kw):
line = await request.content.readline() line = await request.content.readline()
content = '' content = ''
while line: while line:
info(f'read from request stream {line=}')
txt = await engine.stt(line) txt = await engine.stt(line)
content += txt content += txt
d = json.dumps({'content':content}) d = json.dumps({'content':content})
@ -19,6 +21,7 @@ async def generate(request, **kw):
await resp.write(btxt) await resp.write(btxt)
await resp.drain() await resp.drain()
line = await request.content.readline() line = await request.content.readline()
info('response finish')
return resp return resp
rf = RegisterFunction() rf = RegisterFunction()

View File

@ -1,6 +1,6 @@
{ {
"logger":{ "logger":{
"name":"sage", "name":"asr",
"levelname":"info", "levelname":"info",
"logfile":"$[workdir]$/logs/sage.log" "logfile":"$[workdir]$/logs/sage.log"
}, },