mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-01-26 18:12:47 +08:00
🐛 修复历史记录反复加载导致的context为空列表
This commit is contained in:
parent
f03a41d38a
commit
d10e303627
@ -82,9 +82,9 @@ async def praises():
|
|||||||
|
|
||||||
@contexts_cmd.handle()
|
@contexts_cmd.handle()
|
||||||
async def contexts(target: MsgTarget):
|
async def contexts(target: MsgTarget):
|
||||||
context.set_context(
|
backup_context = await get_backup_context(target.id, target.private)
|
||||||
await get_backup_context(target.id, target.private), target.id, target.private
|
if not backup_context:
|
||||||
) # 加载历史记录
|
context.set_context(backup_context, target.id, target.private) # 加载历史记录
|
||||||
await contexts_cmd.finish(str(context.build(target.id, target.private)))
|
await contexts_cmd.finish(str(context.build(target.id, target.private)))
|
||||||
|
|
||||||
|
|
||||||
@ -183,9 +183,9 @@ async def marsho(target: MsgTarget, event: Event, text: Optional[UniMsg] = None)
|
|||||||
)
|
)
|
||||||
elif config.marshoai_enable_support_image_tip:
|
elif config.marshoai_enable_support_image_tip:
|
||||||
await UniMessage("*此模型不支持图片处理。").send()
|
await UniMessage("*此模型不支持图片处理。").send()
|
||||||
context.set_context(
|
backup_context = await get_backup_context(target.id, target.private)
|
||||||
await get_backup_context(target.id, target.private), target.id, target.private
|
if not backup_context:
|
||||||
) # 加载历史记录
|
context.set_context(backup_context, target.id, target.private) # 加载历史记录
|
||||||
context_msg = context.build(target.id, target.private)
|
context_msg = context.build(target.id, target.private)
|
||||||
target_list.append([target.id, target.private])
|
target_list.append([target.id, target.private])
|
||||||
if not is_reasoning_model:
|
if not is_reasoning_model:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user