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
2 changed files with 2 additions and 2 deletions
|
|
@ -399,7 +399,7 @@ class ComponentBase(ABC):
|
|||
self._param.check()
|
||||
|
||||
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
|
||||
|
||||
def run(self, history, **kwargs):
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class Generate(ComponentBase):
|
|||
component_name = "Generate"
|
||||
|
||||
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
|
||||
|
||||
def set_cite(self, retrieval_res, answer):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue