mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-02-07 05:56:11 +08:00
⭐增设版权声明,更新授权年份,主题色! (#2)
* 优化更新
* 代码不够黑,新增一个空行
* ?
* 空格?
* 新年新气象,莫生气
* 又是空格
* 附和:zhDateTime1.1.1 修复过于愚蠢导致的问题
* ⭐增设版权声明,更新授权年份,主题色!
* ?怎么没删
* 更新 zhDateTime 库版本,主题色往文档里塞
* 我愚蠢了
This commit is contained in:
parent
23ca88b93a
commit
2afe3c48ce
@ -3,7 +3,7 @@ LiteyukiStudio Opensource license
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Copyright © 2024 <copyright holders>
|
Copyright © 2025 Asankilp & LiteyukiStudio
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2024 LiteyukiStudio
|
Copyright (c) 2025 Asankilp & LiteyukiStudio
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2024 EillesWan
|
Copyright (c) 2025 EillesWan
|
||||||
nonebot-plugin-latex & other specified codes is licensed under Mulan PSL v2.
|
nonebot-plugin-latex & other specified codes is licensed under Mulan PSL v2.
|
||||||
You can use this software according to the terms and conditions of the Mulan PSL v2.
|
You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||||
You may obtain a copy of Mulan PSL v2 at:
|
You may obtain a copy of Mulan PSL v2 at:
|
||||||
|
@ -49,6 +49,8 @@ _谁不喜欢回复消息快又可爱的猫娘呢?_
|
|||||||
|
|
||||||
## ❤ 鸣谢&版权说明
|
## ❤ 鸣谢&版权说明
|
||||||
|
|
||||||
|
> Copyright (c) 2025 Asankilp & LiteyukiStudio
|
||||||
|
|
||||||
本项目使用了以下项目的代码:
|
本项目使用了以下项目的代码:
|
||||||
|
|
||||||
- [nonebot-plugin-latex](https://github.com/EillesWan/nonebot-plugin-latex)
|
- [nonebot-plugin-latex](https://github.com/EillesWan/nonebot-plugin-latex)
|
||||||
|
@ -14,7 +14,7 @@ title: config
|
|||||||
|
|
||||||
#### ***attr*** `marshoai_aliases: set[str] = {'小棉'}`
|
#### ***attr*** `marshoai_aliases: set[str] = {'小棉'}`
|
||||||
|
|
||||||
#### ***attr*** `marshoai_main_colour: str = 'FFAAAA'`
|
#### ***attr*** `marshoai_main_colour: str = 'FEABA9'`
|
||||||
|
|
||||||
#### ***attr*** `marshoai_default_model: str = 'gpt-4o-mini'`
|
#### ***attr*** `marshoai_default_model: str = 'gpt-4o-mini'`
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ Add options in the `.env` file from the diagram below in nonebot2 project.
|
|||||||
| MARSHOAI_DEFAULT_NAME | `str` | `marsho` | Command to call Marsho |
|
| MARSHOAI_DEFAULT_NAME | `str` | `marsho` | Command to call Marsho |
|
||||||
| MARSHOAI_ALIASES | `set[str]` | `list["小棉"]` | Other name(Alias) to call Marsho |
|
| MARSHOAI_ALIASES | `set[str]` | `list["小棉"]` | Other name(Alias) to call Marsho |
|
||||||
| MARSHOAI_AT | `bool` | `false` | Call by @ or not |
|
| MARSHOAI_AT | `bool` | `false` | Call by @ or not |
|
||||||
| MARSHOAI_MAIN_COLOUR | `str` | `FFAAAA` | Theme color, used by some tools and features |
|
| MARSHOAI_MAIN_COLOUR | `str` | `FEABA9` | Theme color, used by some tools and features |
|
||||||
|
|
||||||
#### AI call
|
#### AI call
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ title: config
|
|||||||
|
|
||||||
#### ***attr*** `marshoai_aliases: set[str] = {'小棉'}`
|
#### ***attr*** `marshoai_aliases: set[str] = {'小棉'}`
|
||||||
|
|
||||||
#### ***attr*** `marshoai_main_colour: str = 'FFAAAA'`
|
#### ***attr*** `marshoai_main_colour: str = 'FEABA9'`
|
||||||
|
|
||||||
#### ***attr*** `marshoai_default_model: str = 'gpt-4o-mini'`
|
#### ***attr*** `marshoai_default_model: str = 'gpt-4o-mini'`
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ title: 安装
|
|||||||
| MARSHOAI_DEFAULT_NAME | `str` | `marsho` | 调用 Marsho 默认的命令前缀 |
|
| MARSHOAI_DEFAULT_NAME | `str` | `marsho` | 调用 Marsho 默认的命令前缀 |
|
||||||
| MARSHOAI_ALIASES | `set[str]` | `set{"小棉"}` | 调用 Marsho 的命令别名 |
|
| MARSHOAI_ALIASES | `set[str]` | `set{"小棉"}` | 调用 Marsho 的命令别名 |
|
||||||
| MARSHOAI_AT | `bool` | `false` | 决定是否使用at触发 |
|
| MARSHOAI_AT | `bool` | `false` | 决定是否使用at触发 |
|
||||||
| MARSHOAI_MAIN_COLOUR | `str` | `FFAAAA` | 主题色,部分工具和功能可用 |
|
| MARSHOAI_MAIN_COLOUR | `str` | `FEABA9` | 主题色,部分工具和功能可用 |
|
||||||
|
|
||||||
#### AI 调用
|
#### AI 调用
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ GitHub Models API 的限制较多,不建议使用,建议通过修改`MARSHOA
|
|||||||
| MARSHOAI_DEFAULT_NAME | `str` | `marsho` | 调用 Marsho 默认的命令前缀 |
|
| MARSHOAI_DEFAULT_NAME | `str` | `marsho` | 调用 Marsho 默认的命令前缀 |
|
||||||
| MARSHOAI_ALIASES | `set[str]` | `list["小棉"]` | 调用 Marsho 的命令别名 |
|
| MARSHOAI_ALIASES | `set[str]` | `list["小棉"]` | 调用 Marsho 的命令别名 |
|
||||||
| MARSHOAI_AT | `bool` | `false` | 决定是否使用at触发 |
|
| MARSHOAI_AT | `bool` | `false` | 决定是否使用at触发 |
|
||||||
| MARSHOAI_MAIN_COLOUR | `str` | `FFAAAA` | 主题色,部分工具和功能可用 |
|
| MARSHOAI_MAIN_COLOUR | `str` | `FEABA9` | 主题色,部分工具和功能可用 |
|
||||||
|
|
||||||
#### AI 调用
|
#### AI 调用
|
||||||
|
|
||||||
|
@ -1,3 +1,27 @@
|
|||||||
|
"""
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2025 Asankilp & LiteyukiStudio
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
"""
|
||||||
|
|
||||||
from nonebot.plugin import require
|
from nonebot.plugin import require
|
||||||
|
|
||||||
require("nonebot_plugin_alconna")
|
require("nonebot_plugin_alconna")
|
||||||
|
@ -16,7 +16,7 @@ class ConfigModel(BaseModel):
|
|||||||
marshoai_aliases: list[str] = [
|
marshoai_aliases: list[str] = [
|
||||||
"小棉",
|
"小棉",
|
||||||
]
|
]
|
||||||
marshoai_main_colour: str = "FFAAAA"
|
marshoai_main_colour: str = "FEABA9"
|
||||||
marshoai_default_model: str = "gpt-4o-mini"
|
marshoai_default_model: str = "gpt-4o-mini"
|
||||||
marshoai_prompt: str = (
|
marshoai_prompt: str = (
|
||||||
"你是一只可爱的猫娘,你的生日是9月6日,你喜欢晒太阳,撒娇,吃零食,玩耍等等可爱的事情,偶尔会调皮一下,"
|
"你是一只可爱的猫娘,你的生日是9月6日,你喜欢晒太阳,撒娇,吃零食,玩耍等等可爱的事情,偶尔会调皮一下,"
|
||||||
|
@ -8,7 +8,7 @@ marshoai_aliases:
|
|||||||
|
|
||||||
marshoai_at: false # 决定是否开启at响应
|
marshoai_at: false # 决定是否开启at响应
|
||||||
|
|
||||||
marshoai_main_colour: "FFAAAA" # 默认主色,部分插件和功能使用
|
marshoai_main_colour: "FEABA9" # 默认主色,部分插件和功能使用
|
||||||
marshoai_default_model: "gpt-4o-mini" # 默认模型,设定为gpt-4o-mini。
|
marshoai_default_model: "gpt-4o-mini" # 默认模型,设定为gpt-4o-mini。
|
||||||
|
|
||||||
# 主提示词,定义了Marsho的性格和行为,包含多语言名字翻译规则和对特定问题的回答约束。
|
# 主提示词,定义了Marsho的性格和行为,包含多语言名字翻译规则和对特定问题的回答约束。
|
||||||
|
@ -13,15 +13,17 @@ __marsho_meta__ = PluginMetadata(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
weekdays = ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"]
|
||||||
|
|
||||||
|
|
||||||
@on_function_call(description="获取当前时间,日期和星期")
|
@on_function_call(description="获取当前时间,日期和星期")
|
||||||
async def get_current_time() -> str:
|
async def get_current_time() -> str:
|
||||||
"""获取当前的时间和日期"""
|
"""获取当前的时间和日期"""
|
||||||
current_time = DateTime.now().strftime("%Y.%m.%d %H:%M:%S")
|
current_time = DateTime.now()
|
||||||
current_weekday = DateTime.now().weekday()
|
|
||||||
|
|
||||||
weekdays = ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"]
|
time_prompt = "现在的时间是 {},{},{}。".format(
|
||||||
current_weekday_name = weekdays[current_weekday]
|
current_time.strftime("%Y.%m.%d %H:%M:%S"),
|
||||||
|
weekdays[current_time.weekday()],
|
||||||
current_lunar_date = DateTime.now().to_lunar().date_hanzify()[5:]
|
current_time.chinesize.date_hanzify("农历{干支年}{生肖}年 {月份}月{数序日}"),
|
||||||
time_prompt = f"现在的时间是 {current_time},{current_weekday_name},农历 {current_lunar_date}。"
|
)
|
||||||
return time_prompt
|
return time_prompt
|
||||||
|
@ -30,7 +30,7 @@ NOT_GIVEN = NotGiven()
|
|||||||
# 时间参数相关
|
# 时间参数相关
|
||||||
if config.marshoai_enable_time_prompt:
|
if config.marshoai_enable_time_prompt:
|
||||||
_weekdays = ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"]
|
_weekdays = ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"]
|
||||||
_time_prompt = "现在的时间是{date_time},{weekday_name},农历{lunar_date}。"
|
_time_prompt = "现在的时间是{date_time}{weekday_name},{lunar_date}。"
|
||||||
|
|
||||||
|
|
||||||
# noinspection LongLine
|
# noinspection LongLine
|
||||||
@ -254,8 +254,7 @@ async def refresh_nickname_json():
|
|||||||
|
|
||||||
def get_prompt():
|
def get_prompt():
|
||||||
"""获取系统提示词"""
|
"""获取系统提示词"""
|
||||||
prompts = ""
|
prompts = config.marshoai_additional_prompt
|
||||||
prompts += config.marshoai_additional_prompt
|
|
||||||
if config.marshoai_enable_praises:
|
if config.marshoai_enable_praises:
|
||||||
praises_prompt = build_praises()
|
praises_prompt = build_praises()
|
||||||
prompts += praises_prompt
|
prompts += praises_prompt
|
||||||
@ -266,8 +265,8 @@ def get_prompt():
|
|||||||
"%Y年%m月%d日 %H:%M:%S"
|
"%Y年%m月%d日 %H:%M:%S"
|
||||||
),
|
),
|
||||||
weekday_name=_weekdays[current_time.weekday()],
|
weekday_name=_weekdays[current_time.weekday()],
|
||||||
lunar_date=current_time.to_lunar().date_hanzify(
|
lunar_date=current_time.chinesize.date_hanzify(
|
||||||
"{干支年}{生肖}年{月份}月{日期}日"
|
"农历{干支年}{生肖}年{月份}月{日期}"
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ dependencies = [
|
|||||||
"nonebot2>=2.4.0",
|
"nonebot2>=2.4.0",
|
||||||
"nonebot-plugin-alconna>=0.48.0",
|
"nonebot-plugin-alconna>=0.48.0",
|
||||||
"nonebot-plugin-localstore>=0.7.1",
|
"nonebot-plugin-localstore>=0.7.1",
|
||||||
"zhDatetime>=1.1.1",
|
"zhDatetime>=2.0.0",
|
||||||
"aiohttp>=3.9",
|
"aiohttp>=3.9",
|
||||||
"httpx>=0.27.0",
|
"httpx>=0.27.0",
|
||||||
"ruamel.yaml>=0.18.6",
|
"ruamel.yaml>=0.18.6",
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
# Marsho Resources
|
# Marsho Resources
|
||||||
|
|
||||||
|
> Copyright (c) 2025 [@Asankilp](https://github.com/Asankilp)
|
||||||
|
|
||||||
本目录存放 Marsho 的图像资源(logo, icon),均由[Asankilp](https://github.com/Asankilp)绘制。\
|
本目录存放 Marsho 的图像资源(logo, icon),均由[Asankilp](https://github.com/Asankilp)绘制。\
|
||||||
上述所有资源均在[CC BY-NC-SA 4.0](http://creativecommons.org/licenses/by-nc-sa/4.0/)许可下提供。
|
上述所有资源均在[CC BY-NC-SA 4.0](http://creativecommons.org/licenses/by-nc-sa/4.0/)许可下提供。
|
||||||
|
Loading…
x
Reference in New Issue
Block a user