mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix: agent second round issue. (#9863)
### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -17,6 +17,7 @@ import json
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
from copy import deepcopy
|
||||||
from typing import Any, Generator
|
from typing import Any, Generator
|
||||||
import json_repair
|
import json_repair
|
||||||
from functools import partial
|
from functools import partial
|
||||||
@ -141,7 +142,7 @@ class LLM(ComponentBase):
|
|||||||
for p in self._param.prompts:
|
for p in self._param.prompts:
|
||||||
if msg and msg[-1]["role"] == p["role"]:
|
if msg and msg[-1]["role"] == p["role"]:
|
||||||
continue
|
continue
|
||||||
msg.append(p)
|
msg.append(deepcopy(p))
|
||||||
|
|
||||||
sys_prompt = self.string_format(sys_prompt, args)
|
sys_prompt = self.string_format(sys_prompt, args)
|
||||||
for m in msg:
|
for m in msg:
|
||||||
|
|||||||
Reference in New Issue
Block a user