mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-15 21:55:55 +08:00
Fix agent non stream (#1904)
### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
e9e39d57ce
commit
cd861e3653
@ -460,13 +460,11 @@ class ComponentBase(ABC):
|
|||||||
upstream_outs.append(pd.DataFrame([{"content": c}]))
|
upstream_outs.append(pd.DataFrame([{"content": c}]))
|
||||||
break
|
break
|
||||||
break
|
break
|
||||||
if self.component_name.lower().find("answer") >= 0:
|
if self.component_name.lower().find("answer") >= 0 and self.get_component_name(u) in ["relevant"]:
|
||||||
if self.get_component_name(u) in ["relevant"]:
|
continue
|
||||||
continue
|
o = self._canvas.get_component(u)["obj"].output(allow_partial=False)[1]
|
||||||
else:
|
if o is not None:
|
||||||
o = self._canvas.get_component(u)["obj"].output(allow_partial=False)[1]
|
upstream_outs.append(o)
|
||||||
if o is not None:
|
|
||||||
upstream_outs.append(o)
|
|
||||||
break
|
break
|
||||||
|
|
||||||
if upstream_outs:
|
if upstream_outs:
|
||||||
|
@ -282,13 +282,9 @@ def completion():
|
|||||||
canvas.reference.append(final_ans["reference"])
|
canvas.reference.append(final_ans["reference"])
|
||||||
cvs.dsl = json.loads(str(canvas))
|
cvs.dsl = json.loads(str(canvas))
|
||||||
|
|
||||||
result = None
|
result = {"answer": final_ans["content"], "reference": final_ans.get("reference", [])}
|
||||||
for ans in answer():
|
fillin_conv(result)
|
||||||
ans = {"answer": ans["content"], "reference": ans.get("reference", [])}
|
API4ConversationService.append_message(conv.id, conv.to_dict())
|
||||||
result = ans
|
|
||||||
fillin_conv(ans)
|
|
||||||
API4ConversationService.append_message(conv.id, conv.to_dict())
|
|
||||||
break
|
|
||||||
rename_field(result)
|
rename_field(result)
|
||||||
return get_json_result(data=result)
|
return get_json_result(data=result)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user