Merge pull request #22 from iorisa/feature/img

fixbug: fix 图片
This commit is contained in:
Justin-ZL 2023-09-02 22:37:08 +08:00 committed by GitHub
commit db8cec194b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,5 +35,5 @@ async def text_to_image(text, size_type: str = "512x512", openai_api_key="", mod
s3 = S3()
url = await s3.cache(data=base64_data, file_ext=".png", format=BASE64_FORMAT)
if url:
return f"[{text}]({url})"
return f"![{text}]({url})"
return image_declaration + base64_data if base64_data else ""