mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-07-31 08:59:51 +00:00
重构模型参数配置,合并为marshoai_model_args字典 (#11)
This commit is contained in:
@ -55,9 +55,7 @@ class ConfigModel(BaseModel):
|
||||
marshoai_toolset_dir: list = []
|
||||
marshoai_disabled_toolkits: list = []
|
||||
marshoai_azure_endpoint: str = "https://models.inference.ai.azure.com"
|
||||
marshoai_temperature: float | None = None
|
||||
marshoai_max_tokens: int | None = None
|
||||
marshoai_top_p: float | None = None
|
||||
marshoai_model_args: dict = {}
|
||||
marshoai_timeout: float | None = 50.0
|
||||
marshoai_nickname_limit: int = 16
|
||||
marshoai_additional_image_models: list = []
|
||||
|
@ -61,9 +61,7 @@ marshoai_devmode: false # 是否启用开发者模式。
|
||||
marshoai_azure_endpoint: "https://models.inference.ai.azure.com" # OpenAI 标准格式 API 的端点。
|
||||
|
||||
# 模型参数配置
|
||||
marshoai_temperature: null # 调整生成的多样性,未设置时使用默认值。
|
||||
marshoai_max_tokens: null # 最大生成的token数,未设置时使用默认值。
|
||||
marshoai_top_p: null # 使用的概率采样值,未设置时使用默认值。
|
||||
marshoai_model_args: {} # 模型参数配置,默认空。
|
||||
marshoai_timeout: 50.0 # 请求超时时间。
|
||||
|
||||
marshoai_additional_image_models: [] # 额外的图片模型列表,默认空。
|
||||
|
@ -126,9 +126,7 @@ async def make_chat(
|
||||
messages=msg,
|
||||
model=model_name,
|
||||
tools=tools,
|
||||
temperature=config.marshoai_temperature,
|
||||
max_tokens=config.marshoai_max_tokens,
|
||||
top_p=config.marshoai_top_p,
|
||||
**config.marshoai_model_args,
|
||||
)
|
||||
|
||||
|
||||
@ -151,10 +149,8 @@ async def make_chat_openai(
|
||||
messages=msg,
|
||||
model=model_name,
|
||||
tools=tools or NOT_GIVEN,
|
||||
temperature=config.marshoai_temperature or NOT_GIVEN,
|
||||
max_tokens=config.marshoai_max_tokens or NOT_GIVEN,
|
||||
top_p=config.marshoai_top_p or NOT_GIVEN,
|
||||
timeout=config.marshoai_timeout,
|
||||
**config.marshoai_model_args,
|
||||
)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user