diff --git a/llmage/llmclient.py b/llmage/llmclient.py index 93cfdd9..5cb8d5d 100644 --- a/llmage/llmclient.py +++ b/llmage/llmclient.py @@ -1,3 +1,4 @@ +import json from random import randint from functools import partial from traceback import format_exc @@ -73,10 +74,12 @@ where a.upappid=b.id async def uapi_request(request, sor, caller_orgid, callerid, uapi, llm, params): userid = await get_owner_userid(sor, llm) - txt = + txt = '' async for l in uapi.stream_linify(llm.upappid, llm.apiname, userid, params=params): + d = json.loads(l) + txt = txt + d['content'] yield l - + debug(f'{d=}, {txt=}') async def inference(request, *args, **kw): env = request._run_ns