bugfix
This commit is contained in:
parent
d4ff002c16
commit
83f3cc11eb
@ -83,11 +83,13 @@ async def uapi_request(request, sor, caller_orgid, callerid, uapi, llm, params):
|
|||||||
yield l
|
yield l
|
||||||
debug(f'{d=}, {txt=}')
|
debug(f'{d=}, {txt=}')
|
||||||
|
|
||||||
def b64media(meidafile):
|
def b64media(mediafile):
|
||||||
if meidafile.startswith('data:'):
|
if mediafile.startswith('data:'):
|
||||||
return meidafile
|
return mediafile
|
||||||
|
if mediafile.startswith('http://') or mediafile.startswith('https://'):
|
||||||
|
return mediafile
|
||||||
fs = FileStorage()
|
fs = FileStorage()
|
||||||
fn = fs.realPath(meidafile)
|
fn = fs.realPath(mediafile)
|
||||||
with open(fn, 'rb') as f:
|
with open(fn, 'rb') as f:
|
||||||
b = f.read()
|
b = f.read()
|
||||||
return base64.b64encode(b).decode('iso-8859-1')
|
return base64.b64encode(b).decode('iso-8859-1')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user