use pillow
This commit is contained in:
parent
3008ecb2a9
commit
c83fe2f92a
5
azure.py
5
azure.py
@ -14,7 +14,7 @@ from azure.ai.inference.aio import ChatCompletionsClient
|
|||||||
from azure.ai.inference.models import SystemMessage, UserMessage, TextContentItem, ImageContentItem, ImageUrl
|
from azure.ai.inference.models import SystemMessage, UserMessage, TextContentItem, ImageContentItem, ImageUrl
|
||||||
from azure.core.credentials import AzureKeyCredential
|
from azure.core.credentials import AzureKeyCredential
|
||||||
from .__init__ import __plugin_meta__
|
from .__init__ import __plugin_meta__
|
||||||
import imghdr
|
from PIL import Image
|
||||||
from .config import config
|
from .config import config
|
||||||
changemdl = on_command("changemodel",permission=SUPERUSER)
|
changemdl = on_command("changemodel",permission=SUPERUSER)
|
||||||
resetmem = on_command("reset",permission=SUPERUSER)
|
resetmem = on_command("reset",permission=SUPERUSER)
|
||||||
@ -102,7 +102,7 @@ async def neko(
|
|||||||
await download_file(str(imgurl))
|
await download_file(str(imgurl))
|
||||||
picmsg = ImageContentItem(image_url=ImageUrl.load(
|
picmsg = ImageContentItem(image_url=ImageUrl.load(
|
||||||
image_file="./azureaipic.png",
|
image_file="./azureaipic.png",
|
||||||
image_format=imghdr.what("azureaipic.png")
|
image_format=Image.open("azureaipic.png").format
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
usermsg.append(picmsg)
|
usermsg.append(picmsg)
|
||||||
@ -120,6 +120,7 @@ async def neko(
|
|||||||
context.append(UserMessage(content=usermsg))
|
context.append(UserMessage(content=usermsg))
|
||||||
context.append(choice.message)
|
context.append(choice.message)
|
||||||
context_count += 1
|
context_count += 1
|
||||||
|
#await UniMessage(str(choice)).send()
|
||||||
await UniMessage(str(choice.message.content)).send(reply_to=True)
|
await UniMessage(str(choice.message.content)).send(reply_to=True)
|
||||||
#requests_limit = response.headers.get('x-ratelimit-limit-requests')
|
#requests_limit = response.headers.get('x-ratelimit-limit-requests')
|
||||||
#request_id = response.headers.get('x-request-id')
|
#request_id = response.headers.get('x-request-id')
|
||||||
|
Reference in New Issue
Block a user