Skip to content

Commit

Permalink
⚛️v0.2.2,新增1个配置项
Browse files Browse the repository at this point in the history
  • Loading branch information
Asankilp committed Oct 4, 2024
1 parent a0bfa7f commit c440499
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 数 |
2 changes: 1 addition & 1 deletion nonebot_plugin_marshoai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
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 : 重置当前会话的上下文。 ※需要加上命令前缀使用(默认为'/')。
Expand Down
3 changes: 2 additions & 1 deletion nonebot_plugin_marshoai/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
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 @@ -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)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit c440499

Please sign in to comment.