Closed twinstar26 closed 4 years ago
@twinstar26 Tarbot skill is meant to provide user with command given its natural language usage. If there isn't any matching intent, I would recommend passing None
as a data object similar to how confidence is set to 0.0
in the beginning.
Sorry! I misunderstood the flow. Thanks for pointing out!!
I originally thought that after recognizing intent only then control flow would be passed to specific skill for further parameter recognition.
But the orchestration layer broadcasts response to every skill and collects confidence at the end. So yeah makes sense.
Describe the bug UnboundLocalError: local variable 'data' referenced before assignment in nlc2cmd/wa_skills/tarbot.py
To Reproduce Steps to reproduce the behavior:
output
#
cat nohup.out Exception in thread Thread-8: Traceback (most recent call last): File "/usr/local/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/local/lib/python3.6/threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "/opt/local/share/clai/bin/clai/server/plugins/nlc2cmd/service.py", line 24, in __compute result.append( eval('wa_skills.' + args[0])(args[1]) ) File "/opt/local/share/clai/bin/clai/server/plugins/nlc2cmd/wa_skills/tarbot.py", line 157, in wa_skill_processor_tarbot return data, confidence UnboundLocalError: local variable 'data' referenced before assignmentshell and OS (please complete the following information):
Additional context https://github.com/IBM/clai/blob/77612341d7c45d3a00afaca594f438ee7ec86b2c/clai/server/plugins/nlc2cmd/wa_skills/tarbot.py#L155
how to solve When this else statement is triggered,
data
is not defined before hitting this line and we are returningdata
in the next statement. So we need to define default value ofdata
.