mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Feat: add citation option to agent and enlarge the timeouts. (#9484)
### What problem does this PR solve? #9422 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -244,7 +244,7 @@ class Agent(LLM, ToolBase):
|
||||
|
||||
def complete():
|
||||
nonlocal hist
|
||||
need2cite = self._canvas.get_reference()["chunks"] and self._id.find("-->") < 0
|
||||
need2cite = self._param.cite and self._canvas.get_reference()["chunks"] and self._id.find("-->") < 0
|
||||
cited = False
|
||||
if hist[0]["role"] == "system" and need2cite:
|
||||
if len(hist) < 7:
|
||||
|
||||
@ -145,7 +145,7 @@ class LLM(ComponentBase):
|
||||
prompt = self.string_format(prompt, args)
|
||||
for m in msg:
|
||||
m["content"] = self.string_format(m["content"], args)
|
||||
if self._canvas.get_reference()["chunks"]:
|
||||
if self._param.cite and self._canvas.get_reference()["chunks"]:
|
||||
prompt += citation_prompt()
|
||||
|
||||
return prompt, msg
|
||||
|
||||
Reference in New Issue
Block a user