diff --git a/README.md b/README.md index a926813..7d6d9bc 100644 --- a/README.md +++ b/README.md @@ -126,4 +126,5 @@ _✨ 使用 Azure OpenAI 推理服务的聊天机器人插件 ✨_ | MARSHOAI_ENABLE_TIME_PROMPT | 否 | `true` | 是否启用实时更新的日期与时间(精确到秒)与农历日期系统提示词 | | MARSHOAI_AZURE_ENDPOINT | 否 | `https://models.inference.ai.azure.com` | 调用 Azure OpenAI 服务的 API 终结点 | | MARSHOAI_TEMPERATURE | 否 | 无 | 进行推理时的温度参数 | +| MARSHOAI_TOP_P | 否 | 无 | 进行推理时的核采样参数 | | MARSHOAI_MAX_TOKENS | 否 | 无 | 返回消息的最大 token 数 | \ No newline at end of file diff --git a/nonebot_plugin_marshoai/__init__.py b/nonebot_plugin_marshoai/__init__.py index 23139eb..039b079 100644 --- a/nonebot_plugin_marshoai/__init__.py +++ b/nonebot_plugin_marshoai/__init__.py @@ -5,7 +5,7 @@ from .azure import * from nonebot import get_driver, logger from .config import ConfigModel, config import nonebot_plugin_localstore as store -usage = """MarshoAI Alpha by Asankilp +usage = """MarshoAI Beta by Asankilp 用法: marsho <聊天内容> : 与 Marsho 进行对话。当模型为 GPT-4o(-mini) 等时,可以带上图片进行对话。 reset : 重置当前会话的上下文。 ※需要加上命令前缀使用(默认为'/')。 diff --git a/nonebot_plugin_marshoai/azure.py b/nonebot_plugin_marshoai/azure.py index 6143720..8f473d5 100644 --- a/nonebot_plugin_marshoai/azure.py +++ b/nonebot_plugin_marshoai/azure.py @@ -123,7 +123,8 @@ async def marsho( messages=context.build(target.id, target.private)+[UserMessage(content=usermsg)], model=model_name, temperature=config.marshoai_temperature, - max_tokens=config.marshoai_max_tokens + max_tokens=config.marshoai_max_tokens, + top_p=config.marshoai_top_p ) #await UniMessage(str(response)).send() choice = response.choices[0] diff --git a/nonebot_plugin_marshoai/config.py b/nonebot_plugin_marshoai/config.py index 655be6c..5d45996 100644 --- a/nonebot_plugin_marshoai/config.py +++ b/nonebot_plugin_marshoai/config.py @@ -13,4 +13,5 @@ class ConfigModel(BaseModel): marshoai_azure_endpoint: str = "https://models.inference.ai.azure.com" marshoai_temperature: float = None marshoai_max_tokens: int = None + marshoai_top_p: float = None config: ConfigModel = get_plugin_config(ConfigModel) diff --git a/pyproject.toml b/pyproject.toml index f1ccdff..b60b3c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "nonebot-plugin-marshoai" -version = "0.2.1" +version = "0.2.2" description = "Nonebot2插件,调用Azure OpenAI服务实现猫娘聊天" readme = "README.md" requires-python = "<4.0,>=3.9"