diff --git a/llmage/llmclient.py b/llmage/llmclient.py index 5f95ea0..d322b0c 100644 --- a/llmage/llmclient.py +++ b/llmage/llmclient.py @@ -388,7 +388,8 @@ async def inference_generator(request, *args, params_kw=None, **kw): yield d async def _inference_generator(request, callerid, callerorgid, - params_kw=params_kw, **kw): + params_kw={}, **kw): + env = request._run_ns if not params_kw: params_kw = env.params_kw if not params_kw.transno: diff --git a/wwwroot/llminference.dspy b/wwwroot/llminference.dspy index 4baf6a9..e1b20fa 100644 --- a/wwwroot/llminference.dspy +++ b/wwwroot/llminference.dspy @@ -1,7 +1,9 @@ debug(f'{params_kw=}') userid = await get_user() +userorgid = await get_userorgid() if userid is None: return UiError(title='llm inference', message='Please login first') +f = await checkCustomerBalance(params_kw.llmid, userorgid) kdbids = params_kw.kdbids if kdbids: data = {