Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OSS-668: Rasa Knowledge base actions are unable to query about a cert…
…ain attribute of an object unless the user first asks to obtain a list of objects of a specific type. (#922) * modified logic in run, slot management in _query_objects and _query_attribute functions * added get_object_types function * added get_object_type_dynamic function * updated changelog * updated changelog * modified changelog name and content * uncommented code snippet that was previously commented to experiment the contribution changes * added comprehensive typing hint * renamed to * replaced the 'get_object_type_dynamic' function name with the new function name * replaced the 'get_object_type_dynamic' function name with the new function name * modified sentences based on PR review comments * updated the 'get_object_type_dynamic' with new name * directly return entity without assigning it to an unused variable as suggested in PR review * modified line 184 to safeguard against KeyErrors as suggested in PR review * added suggestion to code change in line 185 as mentioned in the PR * added suggestion to code change in line 185 as mentioned in the PR * modified after running grammerly * Added TrackerKnowledgeBase class in tracker.py to set object type slot * modified class name * removed passing object_type value as an argument in functions * imported TrackerKnowledgeBase class | modified function based on changes done in utils.py | assigned extracted object type to object_type variable * removed get_object_types from KnowledgeBase class | removed async from get_object_types * removed await in line 136 after convering get_object_types function from async to normal * modified code to set the object type slot temporarily using the method in Tracker class * removing tracker.py which contained a method to temporarily set the object type slot * removed the import from tracker.py * removed code that gets current_object_type from the slot * converted match_extracted_entities_to_object_types function from async to normal * removed await for match_extracted_entities_to_object_types function * modified action logic after assigning extracted object type to an object_type variable * Unit test functions * Formatted with black * Added line * Removed tab * Resolved all linting issues - flake8 * Fixed Errors * formatted with black * removed entity:attribute appearing twice * removed white space to meet max line charac requirement * entered variables into new line to meet max line charac requirements * removed print statement * reverting the line indentation * formatted code with black * improved language and fixed typos * added get_object_types method in KnowledgeBase parent class * renamned entities_values to entity_names in line 188 * removed duplicated line in line 148 * modified return statement in function docstring * updated the match_extracted_entities_to_object_types doc string to mention the assumption that the user message only contains reference to one object type * renamed match_extracted_entities_to_object_types to match_extracted_entities_to_object_type * renamed match_extracted_entities_to_object_types to match_extracted_entities_to_object_type * reverting a change that wasn't made * improved doc string * changed to * added comment on slot object type resetting * modified if condition in run to check whether latest message attribute * Resolved test_actions failures * Added unit test assertion * Modified test_actions.py and actions.py * modified code logic to include in one line * formatted code with black * Fixed formatting * added comment about slot_object_type resetting * formatted code with black * fixed typos * Reformatted actions file * resolve lint code issue caused by inverted comma * added a comment on replacing new_request with has_attribute_in_latest * modified doc string in run * Fixed trailing whitespace issue * removed keys from entities payload that are not needed for test_utils.py * added function docstring in get_object_types() to look up from parent class * removed repeated info in docstring * modified comment on resetting object type slot based on review suggestion * replaced has_attribute_in_latest with has_attribute_in_latest_message * Fixed linting issues * Reformatted using black * added a rough code on testing the tracker events * removed import logging * added print statements for testing * resolved python mutable issue * removed print statements and cleaned the code * removed import copy * removed trailing white space in line 157 * removed trailing white space in line 157 * added spaces between code lines * added spaces between code lines * added space * Fixed formatting and lint code * made a copy of slots using copy.deepcopy() | modified assertion to check inside actual event list * format with black * added comments in tracker event assertion code block * formatted code --------- Co-authored-by: Gajithra <gajipuvi@gmail.com> Co-authored-by: Gajithira Puvanendran <66731983+Gajithra@users.noreply.github.com> Co-authored-by: Dilanka Sanjula <103400313+Dilanka96@users.noreply.github.com> Co-authored-by: Dilanka96 <dilanka.sanjula@rootcodelabs.com>
- Loading branch information