Spaces:
Running
Running
Commit
·
c15e390
1
Parent(s):
0c04a3c
update selection sync in UI
Browse files
app.py
CHANGED
|
@@ -147,14 +147,11 @@ async def main(message: cl.Message):
|
|
| 147 |
key = next(iter(element)) # Get the first key in the dictionary
|
| 148 |
# Present user with options to choose from
|
| 149 |
actions = [
|
| 150 |
-
cl.Action(name=
|
| 151 |
for value in element['top_matches']
|
| 152 |
]
|
| 153 |
-
actions.append(cl.Action(name="No Update", value="", description="No Update"))
|
| 154 |
-
# Add a "No Update" option
|
| 155 |
res = await cl.AskActionMessage(
|
| 156 |
-
|
| 157 |
-
content=f"Select the correct value for {element[key]}",
|
| 158 |
actions=actions
|
| 159 |
).send()
|
| 160 |
selected_value = res.get("value", "") if res else ""
|
|
|
|
| 147 |
key = next(iter(element)) # Get the first key in the dictionary
|
| 148 |
# Present user with options to choose from
|
| 149 |
actions = [
|
| 150 |
+
cl.Action(name="option", value=value, label=value)
|
| 151 |
for value in element['top_matches']
|
| 152 |
]
|
|
|
|
|
|
|
| 153 |
res = await cl.AskActionMessage(
|
| 154 |
+
content=f"Select the correct value for {key}", # Assuming 'key' is a variable you meant to replace
|
|
|
|
| 155 |
actions=actions
|
| 156 |
).send()
|
| 157 |
selected_value = res.get("value", "") if res else ""
|