IBM / clai

Command Line Artificial Intelligence or CLAI is an open-sourced project from IBM Research aimed to bring the power of AI to the command line interface.
https://clai-home.mybluemix.net/
MIT License
476 stars 73 forks source link

added default value of data #15

Closed twinstar26 closed 4 years ago

twinstar26 commented 4 years ago

:pushpin: References

:tophat: What is the goal?

To fix UnboundLocalError: local variable 'data' referenced before assignment in nlc2cmd/wa_skills/tarbot.py

:memo: How is it being implemented?

By fixing if-else condition. Note that the value of data is taken from $ tar --help. If none of the default conditions are executed this will be the default value. Note that I am not able to reproduce this bug now before writing this patch maybe due to some strange query written by me which I cannot remember.

kpfadnis commented 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 with confidence level of 0.0.

twinstar26 commented 4 years ago

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.