mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2024-11-30 09:14:52 +08:00
⚛️v0.2.2,新增1个配置项
This commit is contained in:
parent
a0bfa7fa7f
commit
c44049933d
@ -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 数 |
|
@ -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 : 重置当前会话的上下文。 ※需要加上命令前缀使用(默认为'/')。
|
||||
|
@ -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]
|
||||
|
@ -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)
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user