👉v0.3.2,增加OneBot v11适配器对于戳一戳消息的响应

This commit is contained in:
2024-10-21 18:04:31 +08:00
parent 74429a3e6c
commit 2eaf719ec9
6 changed files with 63 additions and 18 deletions

View File

@ -7,7 +7,8 @@ import nonebot_plugin_localstore as store
from datetime import datetime
from zhDateTime import DateTime
from pathlib import Path
from azure.ai.inference.models import SystemMessage
from azure.ai.inference.aio import ChatCompletionsClient
from azure.ai.inference.models import SystemMessage, UserMessage
from .config import config
async def get_image_b64(url):
headers = {
@ -28,7 +29,15 @@ async def get_image_b64(url):
return data_url
else:
return None
async def make_chat(client: ChatCompletionsClient, msg, model_name: str):
return await client.complete(
messages=msg,
model=model_name,
temperature=config.marshoai_temperature,
max_tokens=config.marshoai_max_tokens,
top_p=config.marshoai_top_p
)
def get_praises():
praises_file = store.get_plugin_data_file("praises.json") # 夸赞名单文件使用localstore存储
if not os.path.exists(praises_file):