mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-08-01 19:49:59 +00:00
修复流式请求思维链未包含在结构体问题
This commit is contained in:
@ -37,7 +37,7 @@ OPENAI_NEW_MODELS: list = [
|
||||
INTRODUCTION: str = f"""MarshoAI-NoneBot by LiteyukiStudio
|
||||
你好喵~我是一只可爱的猫娘AI,名叫小棉~🐾!
|
||||
我的主页在这里哦~↓↓↓
|
||||
https://marshoai-docs.pages.liteyuki.icu
|
||||
https://marsho.liteyuki.icu
|
||||
|
||||
※ 使用 「{config.marshoai_default_name}.status」命令获取状态信息。
|
||||
※ 使用「{config.marshoai_default_name}.help」命令获取使用说明。"""
|
||||
|
@ -210,10 +210,7 @@ class MarshoHandler:
|
||||
tools_list=tools_list,
|
||||
tool_message=tool_message,
|
||||
)
|
||||
if isinstance(response, ChatCompletion):
|
||||
choice = response.choices[0]
|
||||
else:
|
||||
raise ValueError("Unexpected response type")
|
||||
choice = response.choices[0] # type: ignore
|
||||
# Sprint(choice)
|
||||
# 当tool_calls非空时,将finish_reason设置为TOOL_CALLS
|
||||
if choice.message.tool_calls is not None and config.marshoai_fix_toolcalls:
|
||||
@ -311,6 +308,8 @@ class MarshoHandler:
|
||||
role="assistant",
|
||||
tool_calls=last_chunk.choices[0].delta.tool_calls, # type: ignore
|
||||
)
|
||||
if reasoning_contents != "":
|
||||
setattr(message, "reasoning_content", reasoning_contents)
|
||||
choice = Choice(
|
||||
finish_reason=last_chunk.choices[0].finish_reason, # type: ignore
|
||||
index=last_chunk.choices[0].index,
|
||||
|
Reference in New Issue
Block a user