Skip to content

Commit

Permalink
revert async callback
Browse files Browse the repository at this point in the history
  • Loading branch information
blakerosenthal committed Sep 2, 2024
1 parent 9d68c32 commit 23c0d3d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ragna/deploy/_ui/central_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,16 @@ def __init__(
value=self.content_pane.object, title="Copy"
)

async def click_source_info_callback_wrapper(event):
return await on_click_source_info_callback(event, sources)

# we make this available on the instance so that we can toggle the visibility
self.assistant_toolbar = pn.Row(
self.clipboard_button,
pn.widgets.Button(
name="Source Info",
icon="info-circle",
css_classes=["source-info-button"],
on_click=click_source_info_callback_wrapper,
on_click=lambda event: self.on_click_source_info_callback(
event, self.sources
),
),
visible=assistant_toolbar_visible,
)
Expand All @@ -99,6 +98,8 @@ async def click_source_info_callback_wrapper(event):
object=object,
role=role,
user=user,
sources=sources,
on_click_source_info_callback=on_click_source_info_callback,
timestamp=timestamp,
show_timestamp=show_timestamp,
show_reaction_icons=False,
Expand Down Expand Up @@ -232,7 +233,7 @@ def on_click_chat_info_wrapper(self, event):
],
)

async def on_click_source_info_wrapper(self, event, sources):
def on_click_source_info_wrapper(self, event, sources):
if self.on_click_chat_info is None:
return

Expand Down

0 comments on commit 23c0d3d

Please sign in to comment.