diff --git a/llmage/init.py b/llmage/init.py index e84d897..859c26e 100644 --- a/llmage/init.py +++ b/llmage/init.py @@ -6,6 +6,7 @@ from .keling import keling_token from .jimeng import jimeng_auth_headers from .utils import ( llm_query_orders, + read_webpath, llm_query_price, get_llm_by_model ) @@ -41,6 +42,7 @@ async def start_backend(app): def load_llmage(): env = ServerEnv() env.llm_query_orders = llm_query_orders + env.read_webpath = read_webpath env.get_llm_by_model = get_llm_by_model env.llm_charging = llm_charging env.get_accounting_llmusages = get_accounting_llmusages diff --git a/wwwroot/get_my_asynctasks.dspy b/wwwroot/get_my_asynctasks.dspy index 7e6640a..b6bf008 100644 --- a/wwwroot/get_my_asynctasks.dspy +++ b/wwwroot/get_my_asynctasks.dspy @@ -1,7 +1,9 @@ userid = await get_user() tasks = await get_today_asynctask_list(userid) + for t in tasks: - t.ioinfo = json.loads(t.ioinfo) + bin = await read_webpath(t.ioinfo) + t.ioinfo = json.loads(bin.decode('utf-8') return { 'status': 'ok',