From 83f3cc11eb09735291aefcca4af2bebcfb307a89 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 4 Sep 2025 11:03:09 +0800 Subject: [PATCH] bugfix --- llmage/llmclient.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/llmage/llmclient.py b/llmage/llmclient.py index 4388ebb..532a3fe 100644 --- a/llmage/llmclient.py +++ b/llmage/llmclient.py @@ -83,11 +83,13 @@ async def uapi_request(request, sor, caller_orgid, callerid, uapi, llm, params): yield l debug(f'{d=}, {txt=}') -def b64media(meidafile): - if meidafile.startswith('data:'): - return meidafile +def b64media(mediafile): + if mediafile.startswith('data:'): + return mediafile + if mediafile.startswith('http://') or mediafile.startswith('https://'): + return mediafile fs = FileStorage() - fn = fs.realPath(meidafile) + fn = fs.realPath(mediafile) with open(fn, 'rb') as f: b = f.read() return base64.b64encode(b).decode('iso-8859-1')