diff --git a/rasa_sdk/tracing/instrumentation/attribute_extractors.py b/rasa_sdk/tracing/instrumentation/attribute_extractors.py index 74804d600..80183ac3a 100644 --- a/rasa_sdk/tracing/instrumentation/attribute_extractors.py +++ b/rasa_sdk/tracing/instrumentation/attribute_extractors.py @@ -1,3 +1,5 @@ +import json + from typing import Any, Dict, Text from rasa_sdk.executor import ActionExecutor, CollectingDispatcher from rasa_sdk.forms import ValidationAction @@ -51,6 +53,6 @@ def extract_attrs_for_validation_action( return { "class_name": self.__class__.__name__, "sender_id": tracker.sender_id, - "slots_to_validate": str(slots_to_validate), + "slots_to_validate": json.dumps(list(slots_to_validate)), "action_name": self.name(), } diff --git a/tests/tracing/instrumentation/test_validation_action.py b/tests/tracing/instrumentation/test_validation_action.py index f8ffebdeb..5f745dd06 100644 --- a/tests/tracing/instrumentation/test_validation_action.py +++ b/tests/tracing/instrumentation/test_validation_action.py @@ -17,10 +17,10 @@ @pytest.mark.parametrize( "events, expected_slots_to_validate", [ - ([], "dict_keys([])"), + ([], "[]"), ( [SlotSet("name", "Tom"), SlotSet("address", "Berlin")], - "dict_keys(['name', 'address'])", + '["name", "address"]', ), ], )