@@ -54,12 +54,12 @@ async def check_text(text: str):
54
54
response = await cl.AskActionMessage(
55
55
content = " PII detected" ,
56
56
actions = [
57
- cl.Action(name = " continue" , value = " continue" , label = " ✅ Continue" ),
58
- cl.Action(name = " cancel" , value = " cancel " , label = " ❌ Cancel" ),
57
+ cl.Action(name = " continue" , payload = { " value " : " continue" } , label = " ✅ Continue" ),
58
+ cl.Action(name = " cancel" , payload = { " value " : " continue " } , label = " ❌ Cancel" ),
59
59
],
60
60
).send()
61
61
62
- if response is None or response.get(" value" ) == " cancel" :
62
+ if response is None or response.get(" payload " ).get( " value" ) == " cancel" :
63
63
raise InterruptedError
64
64
65
65
yield
@@ -90,12 +90,12 @@ async def check_text(text: str):
90
90
response = await cl.AskActionMessage(
91
91
content = " PII detected" ,
92
92
actions = [
93
- cl.Action(name = " continue" , value = " continue" , label = " ✅ Continue" ),
94
- cl.Action(name = " cancel" , value = " cancel " , label = " ❌ Cancel" ),
93
+ cl.Action(name = " continue" , payload = { " value " : " continue" } , label = " ✅ Continue" ),
94
+ cl.Action(name = " cancel" , payload = { " value " : " continue " } , label = " ❌ Cancel" ),
95
95
],
96
96
).send()
97
97
98
- if response is None or response.get(" value" ) == " cancel" :
98
+ if response is None or response.get(" payload " ).get( " value" ) == " cancel" :
99
99
raise InterruptedError
100
100
101
101
yield anonymizer.anonymize(
0 commit comments