mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-02-07 21:46:10 +08:00
🐛v0.1.1,更改zhDateTime最低版本
This commit is contained in:
parent
3b931ad66c
commit
f3904c9dd2
@ -5,8 +5,8 @@ from nonebot import get_driver
|
||||
usage = """MarshoAI Alpha by Asankilp
|
||||
用法:
|
||||
marsho <聊天内容> : 与 Marsho 进行对话。当模型为 GPT-4o(-mini) 等时,可以带上图片进行对话。
|
||||
reset : 重置当前会话的上下文。
|
||||
超级用户命令:
|
||||
reset : 重置当前会话的上下文。 ※需要加上命令前缀使用(默认为'/')。
|
||||
超级用户命令(均需要加上命令前缀使用):
|
||||
changemodel <模型名> : 切换全局 AI 模型。
|
||||
contexts : 返回当前会话的上下文列表。 ※当上下文包含图片时,不要使用此命令。
|
||||
praises : 返回夸赞名单的提示词。
|
||||
|
@ -51,12 +51,12 @@ def build_praises():
|
||||
def get_prompt():
|
||||
prompts = ""
|
||||
prompts += config.marshoai_additional_prompt
|
||||
current_time = datetime.now().strftime('%Y.%m.%d %H:%M:%S')
|
||||
current_lunar_date = DateTime.now().to_lunar().date_hanzify()[5:]#库更新之前使用切片
|
||||
if config.marshoai_enable_praises:
|
||||
praises_prompt = build_praises()
|
||||
prompts += praises_prompt
|
||||
if config.marshoai_enable_time_prompt:
|
||||
current_time = datetime.now().strftime('%Y.%m.%d %H:%M:%S')
|
||||
current_lunar_date = DateTime.now().to_lunar().date_hanzify()[5:] #库更新之前使用切片
|
||||
time_prompt = f"现在的时间是{current_time},农历{current_lunar_date}。"
|
||||
prompts += time_prompt
|
||||
marsho_prompt = config.marshoai_prompt
|
||||
@ -71,6 +71,8 @@ def suggest_solution(errinfo: str):
|
||||
suggestion = "模型达到调用速率限制。请稍等一段时间或联系Bot管理员。"
|
||||
elif "tokens_limit_reached" in errinfo:
|
||||
suggestion = "请求token达到上限。请重置上下文。"
|
||||
elif "unauthorized" in errinfo:
|
||||
suggestion = "Azure凭据无效。请联系Bot管理员。"
|
||||
if suggestion != "":
|
||||
return "\n"+suggestion
|
||||
else:
|
||||
|
@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "nonebot-plugin-marshoai"
|
||||
version = "0.1"
|
||||
version = "0.1.1"
|
||||
description = "Nonebot2插件,调用Azure OpenAI服务实现猫娘聊天"
|
||||
readme = "README.md"
|
||||
requires-python = "<4.0,>=3.9"
|
||||
@ -9,7 +9,7 @@ dependencies = [
|
||||
"nonebot2[fastapi, websockets]>=2.2.0",
|
||||
"nonebot-plugin-alconna>=0.48.0",
|
||||
"azure-ai-inference>=1.0.0b4",
|
||||
"zhDatetime>=1.1.0",
|
||||
"zhDatetime>=1.1.1",
|
||||
"aiohttp>=3.9",
|
||||
"httpx>=0.27.0"
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user