mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-07-31 08:59:51 +00:00
👉v0.3.2,增加OneBot v11适配器对于戳一戳消息的响应
This commit is contained in:
@ -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):
|
||||
|
Reference in New Issue
Block a user