Skip to content

Commit a9922a5

Browse files
kaijakevin-k-chang
andauthored
update document (#210)
Co-authored-by: kevin_k_chang <[email protected]>
1 parent 2d1e689 commit a9922a5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

examples/security.mdx

+6-6
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ async def check_text(text: str):
5454
response = await cl.AskActionMessage(
5555
content="PII detected",
5656
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"),
5959
],
6060
).send()
6161

62-
if response is None or response.get("value") == "cancel":
62+
if response is None or response.get("payload").get("value") == "cancel":
6363
raise InterruptedError
6464

6565
yield
@@ -90,12 +90,12 @@ async def check_text(text: str):
9090
response = await cl.AskActionMessage(
9191
content="PII detected",
9292
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"),
9595
],
9696
).send()
9797

98-
if response is None or response.get("value") == "cancel":
98+
if response is None or response.get("payload").get("value") == "cancel":
9999
raise InterruptedError
100100

101101
yield anonymizer.anonymize(

0 commit comments

Comments
 (0)