Skip to content

Commit bd3e033

Browse files
committed
Add on-demand follow-up suggestion icon after successful queries
1 parent 3e17d44 commit bd3e033

4 files changed

Lines changed: 11 additions & 14 deletions

File tree

lumen/ai/ui.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,10 +1635,10 @@ async def _generate_follow_up():
16351635
if len(self.interface):
16361636
message = self.interface.objects[-1]
16371637
existing = [
1638-
obj for obj in (message.footer_actions or [])
1638+
obj for obj in (message.footer_objects or [])
16391639
if getattr(obj, 'name', '') != "FollowUp"
16401640
]
1641-
message.footer_actions = existing + [follow_up_button]
1641+
message.footer_objects = existing + [follow_up_button]
16421642

16431643
def __panel__(self):
16441644
return self._main

lumen/tests/ai/test_ui.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,12 +1615,9 @@ async def noop_callback(contents, user, instance):
16151615

16161616
# --- Follow-up suggestions tests ---
16171617

1618-
def _get_footer_actions(msg):
1619-
"""Get footer actions from message, falling back to footer_objects for older pmui."""
1620-
try:
1621-
return msg.footer_actions or []
1622-
except AttributeError:
1623-
return msg.footer_objects or []
1618+
def _get_footer_objects(msg):
1619+
"""Get footer objects from message."""
1620+
return msg.footer_objects or []
16241621

16251622

16261623
def test_follow_up_suggestion_model():
@@ -1663,7 +1660,7 @@ async def test_follow_up_icon_after_query(explorer_ui):
16631660

16641661
last_msg = ui.interface.objects[-1]
16651662
follow_up_icons = [
1666-
f for f in _get_footer_actions(last_msg)
1663+
f for f in _get_footer_objects(last_msg)
16671664
if getattr(f, 'name', '') == "FollowUp"
16681665
]
16691666
assert len(follow_up_icons) == 1
@@ -1677,7 +1674,7 @@ async def test_follow_up_icon_not_on_error(explorer_ui_with_error):
16771674

16781675
last_msg = ui.interface.objects[-1]
16791676
follow_up_icons = [
1680-
f for f in _get_footer_actions(last_msg)
1677+
f for f in _get_footer_objects(last_msg)
16811678
if getattr(f, 'name', '') == "FollowUp"
16821679
]
16831680
assert len(follow_up_icons) == 0
@@ -1699,7 +1696,7 @@ async def test_follow_up_icon_not_shown_without_pipeline(explorer_ui):
16991696

17001697
last_msg = ui.interface.objects[-1]
17011698
follow_up_icons = [
1702-
f for f in _get_footer_actions(last_msg)
1699+
f for f in _get_footer_objects(last_msg)
17031700
if getattr(f, 'name', '') == "FollowUp"
17041701
]
17051702
assert len(follow_up_icons) == 0
@@ -1733,7 +1730,7 @@ async def test_follow_up_icon_description(explorer_ui):
17331730

17341731
last_msg = ui.interface.objects[-1]
17351732
follow_up_icons = [
1736-
f for f in _get_footer_actions(last_msg)
1733+
f for f in _get_footer_objects(last_msg)
17371734
if getattr(f, 'name', '') == "FollowUp"
17381735
]
17391736
assert len(follow_up_icons) == 1

pixi.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ lint = ["py312", "lint"]
2020
[dependencies]
2121
bokeh = "*"
2222
holoviews = ">=1.17.0"
23-
panel-material-ui = ">=0.9.0"
23+
panel-material-ui = ">=0.9.1"
2424
hvplot = "*"
2525
intake = "<2"
2626
jinja2 = ">3.0"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dependencies = [
4242
"pandas",
4343
"panel >=1.7.5",
4444
"panel-graphic-walker[kernel] >=0.6.4",
45-
"panel-material-ui >=0.8.1",
45+
"panel-material-ui >=0.9.1",
4646
"panel-splitjs >=0.3.2",
4747
"param >=2.2.1",
4848
"pyarrow",

0 commit comments

Comments
 (0)