Skip to content

Commit

Permalink
✨新增允许添加更多支持图片模型的配置项
Browse files Browse the repository at this point in the history
  • Loading branch information
Asankilp committed Nov 20, 2024
1 parent b3f95c2 commit ce6f51f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ _✨ 使用 OpenAI 标准格式 API 的聊天机器人插件 ✨_
| MARSHOAI_TEMPERATURE ||| 进行推理时的温度参数 |
| MARSHOAI_TOP_P ||| 进行推理时的核采样参数 |
| MARSHOAI_MAX_TOKENS ||| 返回消息的最大 token 数 |
| MARSHOAI_ADDITIONAL_IMAGE_MODELS || `[]` | 额外添加的支持图片的模型列表,例如`hunyuan-vision` |

## ❤ 鸣谢&版权说明

Expand Down
2 changes: 1 addition & 1 deletion nonebot_plugin_marshoai/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ async def marsho(target: MsgTarget, event: Event, text: Optional[UniMsg] = None)
"*你未设置自己的昵称。推荐使用'nickname [昵称]'命令设置昵称来获得个性化(可能)回答。"
).send()

is_support_image_model = model_name.lower() in SUPPORT_IMAGE_MODELS
is_support_image_model = model_name.lower() in SUPPORT_IMAGE_MODELS + config.marshoai_additional_image_models
is_reasoning_model = model_name.lower() in REASONING_MODELS
usermsg = [] if is_support_image_model else ""
for i in text:
Expand Down
1 change: 1 addition & 0 deletions nonebot_plugin_marshoai/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class ConfigModel(BaseModel):
marshoai_temperature: float | None = None
marshoai_max_tokens: int | None = None
marshoai_top_p: float | None = None
marshoai_additional_image_models: list = []


config: ConfigModel = get_plugin_config(ConfigModel)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "nonebot-plugin-marshoai"
dynamic = ["version"]
description = "Nonebot2插件,调用Azure OpenAI服务实现猫娘聊天"
description = "Nonebot2插件,调用Azure OpenAI等AI服务实现猫娘聊天"
readme = "README.md"
requires-python = "<4.0,>=3.9"
authors = [{ name = "Asankilp", email = "[email protected]" }]
Expand Down

0 comments on commit ce6f51f

Please sign in to comment.