Closed hasinaxp closed 6 days ago
The changes primarily enhance the message dispatching logic in the async_callback
and callback_function
methods to prevent dispatching empty messages. Additionally, new functionality is introduced in processor.py
to manage live agent actions, including methods for listing and saving these actions. The test suite is updated to cover the new live agent functionalities and ensure correctness in the system's behavior.
Files | Change Summary |
---|---|
kairon/async_callback/processor.py |
Enhanced conditional logic in async_callback and callback_function methods to check for truthy bot_response or data before dispatching messages. |
kairon/shared/data/processor.py |
Added list_live_agent_actions method for fetching live agent actions and updated save_integrated_actions and load_action_configurations methods to include live agent actions functionality. Defined load_live_agent_action method. |
tests/unit_test/data_processor/data_processor_test.py |
Introduced test_list_live_agent_actions to validate the listing of live agent actions. Updated existing tests to include live_agent_action in expected outputs. |
edit_live_agent
function in processor.py
may connect with the enhancements in message dispatching logic.action.py
and processor.py
regarding callback actions relate to improvements in message dispatching and logging.delete_entry
ensure callback configurations are preserved, tying into robustness improvements in message handling.channel_message_dispacher.py
to store messages as strings relate to improvements in message dispatching logic.🐰 In the land where messages hop,
A check was added, now no flop!
Live agents dance, actions in play,
With tests to guard them every day.
A robust system, bright and new,
Hooray for changes, we bid adieu! 🌼
kairon/async_callback/processor.py (2)
`85-86`: **LGTM!** The added conditional check for `bot_response` before dispatching the message is a good improvement. It prevents dispatching potentially empty or null messages, which could lead to unintended behavior or errors in the messaging system. The changes enhance the robustness of the message dispatching process. --- `155-156`: **LGTM!** The added conditional check for `data` before dispatching the message is a good improvement, similar to the changes made in the `async_callback` function. It prevents dispatching potentially empty or null messages, which could lead to unintended behavior or errors in the messaging system. The changes enhance the robustness and consistency of the message dispatching process across the codebase.kairon/shared/data/processor.py (2)
`4179-4196`: **LGTM!** The function retrieves all LiveAgentActionConfig actions for the specified bot, removes sensitive fields, and returns the action configuration as expected. The code changes look good. --- `4937-4944`: **LGTM!** The function loads live agent actions from the database using the `list_live_agent_actions` method and returns them as a dictionary with the appropriate key. The code changes look good.tests/unit_test/data_processor/data_processor_test.py (3)
`1139-1158`: **LGTM!** The new test method `test_list_live_agent_actions` is well-structured and follows the Arrange-Act-Assert pattern. It covers the essential aspects of testing the `list_live_agent_actions` functionality, ensuring that the correct data is returned and that the `_id` field is present and correctly formatted. The assertions verify the expected structure and content of the returned live agent actions, enhancing the test coverage for live agent functionalities. --- `3588-3588`: **LGTM!** The modification to `expected_actions` in the `test_download_data_files_with_actions` method reflects the inclusion of `live_agent_action` in the actions being tested. This change ensures that the method covers the live agent functionality, enhancing the test coverage. --- `3625-3625`: **LGTM!** The modification to `action_config` in the `test_load_action_configurations` method reflects the inclusion of `live_agent_action` in the expected action configuration. This change ensures that the method covers the live agent functionality, enhancing the test coverage.
optional bot_response in callback action (log failure for no bot_response fix) added live agent in upload download
Summary by CodeRabbit