diff --git a/README.md b/README.md index 23f3719a..a9268134 100644 --- a/README.md +++ b/README.md @@ -118,10 +118,12 @@ _✨ 使用 Azure OpenAI 推理服务的聊天机器人插件 ✨_ | 配置项 | 必填 | 默认值 | 说明 | | :---------------: | :--: | :----: | :----------------------------------------------------------: | -| MARSHOAI_TOKEN | 是 | 无 | 调用 API 必需的 token | +| MARSHOAI_TOKEN | 是 | 无 | 调用 API 必需的访问 token | | MARSHOAI_DEFAULT_MODEL | 否 | `gpt-4o-mini` | Marsho 默认调用的模型 | | MARSHOAI_PROMPT | 否 | 猫娘 Marsho 人设提示词 | Marsho 的基本系统提示词 | | MARSHOAI_ADDITIONAL_PROMPT | 否 | 无 | Marsho 的扩展系统提示词 | | MARSHOAI_ENABLE_PRAISES | 否 | `true` | 是否启用夸赞名单功能 | | MARSHOAI_ENABLE_TIME_PROMPT | 否 | `true` | 是否启用实时更新的日期与时间(精确到秒)与农历日期系统提示词 | -| MARSHOAI_AZURE_ENDPOINT | 否 | `https://models.inference.ai.azure.com` | 调用 Azure OpenAI 服务的 API 终结点 | \ No newline at end of file +| MARSHOAI_AZURE_ENDPOINT | 否 | `https://models.inference.ai.azure.com` | 调用 Azure OpenAI 服务的 API 终结点 | +| MARSHOAI_TEMPERATURE | 否 | 无 | 进行推理时的温度参数 | +| MARSHOAI_MAX_TOKENS | 否 | 无 | 返回消息的最大 token 数 | \ No newline at end of file diff --git a/nonebot_plugin_marshoai/azure.py b/nonebot_plugin_marshoai/azure.py index b9c32f47..61437203 100644 --- a/nonebot_plugin_marshoai/azure.py +++ b/nonebot_plugin_marshoai/azure.py @@ -121,7 +121,9 @@ async def marsho( usermsg += str(clean_text) response = await client.complete( messages=context.build(target.id, target.private)+[UserMessage(content=usermsg)], - model=model_name + model=model_name, + temperature=config.marshoai_temperature, + max_tokens=config.marshoai_max_tokens ) #await UniMessage(str(response)).send() choice = response.choices[0] diff --git a/nonebot_plugin_marshoai/config.py b/nonebot_plugin_marshoai/config.py index b472ad9f..655be6c7 100644 --- a/nonebot_plugin_marshoai/config.py +++ b/nonebot_plugin_marshoai/config.py @@ -11,4 +11,6 @@ class ConfigModel(BaseModel): marshoai_enable_praises: bool = True marshoai_enable_time_prompt: bool = True marshoai_azure_endpoint: str = "https://models.inference.ai.azure.com" + marshoai_temperature: float = None + marshoai_max_tokens: int = None config: ConfigModel = get_plugin_config(ConfigModel) diff --git a/pyproject.toml b/pyproject.toml index 6e58da1a..f1ccdff0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "nonebot-plugin-marshoai" -version = "0.2" +version = "0.2.1" description = "Nonebot2插件,调用Azure OpenAI服务实现猫娘聊天" readme = "README.md" requires-python = "<4.0,>=3.9" diff --git a/resources/marsho.svg b/resources/marsho.svg index 41eecc4b..fdfcbde3 100644 --- a/resources/marsho.svg +++ b/resources/marsho.svg @@ -14,7 +14,10 @@ xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:cc="http://creativecommons.org/ns#"> + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> +