mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-14 06:26:00 +08:00
make variables access robuster (#3406)
### What problem does this PR solve? ### Type of change - [x] Performance Improvement
This commit is contained in:
parent
e4c4fdabbd
commit
30c1f7ee29
@ -399,7 +399,7 @@ class ComponentBase(ABC):
|
|||||||
self._param.check()
|
self._param.check()
|
||||||
|
|
||||||
def get_dependent_components(self):
|
def get_dependent_components(self):
|
||||||
cpnts = [para["component_id"] for para in self._param.query if para["component_id"].lower().find("answer") < 0]
|
cpnts = [para["component_id"] for para in self._param.query if para.get("component_id") and para["component_id"].lower().find("answer") < 0]
|
||||||
return cpnts
|
return cpnts
|
||||||
|
|
||||||
def run(self, history, **kwargs):
|
def run(self, history, **kwargs):
|
||||||
|
@ -63,7 +63,7 @@ class Generate(ComponentBase):
|
|||||||
component_name = "Generate"
|
component_name = "Generate"
|
||||||
|
|
||||||
def get_dependent_components(self):
|
def get_dependent_components(self):
|
||||||
cpnts = [para["component_id"] for para in self._param.parameters if para["component_id"].lower().find("answer") < 0]
|
cpnts = [para["component_id"] for para in self._param.parameters if para.get("component_id") and para["component_id"].lower().find("answer") < 0]
|
||||||
return cpnts
|
return cpnts
|
||||||
|
|
||||||
def set_cite(self, retrieval_res, answer):
|
def set_cite(self, retrieval_res, answer):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user