mirror of
https://github.com/FuQuan233/nonebot-plugin-llmchat.git
synced 2025-09-04 10:20:45 +00:00
🐛 修复deque mutated during iteration
This commit is contained in:
parent
52ada66616
commit
19ff0026c0
1 changed files with 4 additions and 2 deletions
|
@ -313,8 +313,10 @@ async def process_messages(group_id: int):
|
|||
content: list[ChatCompletionContentPartParam] = []
|
||||
|
||||
# 将机器人错过的消息推送给LLM
|
||||
for ev in state.past_events:
|
||||
content.append({"type": "text", "text": format_message(ev)})
|
||||
past_events_snapshot = list(state.past_events)
|
||||
for ev in past_events_snapshot:
|
||||
text_content = ",".join([format_message(ev) for ev in past_events_snapshot])
|
||||
content.append({"type": "text", "text": text_content})
|
||||
|
||||
# 将消息中的图片转成 base64
|
||||
if preset.support_image:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue