Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove api wrapper #1

Closed
wants to merge 9 commits into from
Prev Previous commit
Next Next commit
Add engine to left_sidebar initializer and its calls
smokestacklightnin committed Dec 25, 2024
commit 658746cde02b588a3aecbacc23b79db3151f1a3c
3 changes: 2 additions & 1 deletion ragna/deploy/_ui/left_sidebar.py
Original file line number Diff line number Diff line change
@@ -11,10 +11,11 @@ class LeftSidebar(pn.viewable.Viewer):
current_chat_id = param.String(default=None)
refresh_counter = param.Integer(default=0)

def __init__(self, api_wrapper, **params):
def __init__(self, api_wrapper, engine, **params):
super().__init__(**params)

self.api_wrapper = api_wrapper
self._engine = engine
self.on_click_chat = None
self.on_click_new_chat = None

4 changes: 3 additions & 1 deletion ragna/deploy/_ui/main_page.py
Original file line number Diff line number Diff line change
@@ -31,7 +31,9 @@ def __init__(self, api_wrapper, engine, template):
lambda event, title, content: self.show_right_sidebar(title, content)
)

self.left_sidebar = LeftSidebar(api_wrapper=self.api_wrapper)
self.left_sidebar = LeftSidebar(
api_wrapper=self.api_wrapper, engine=self._engine
)
self.left_sidebar.on_click_chat = self.on_click_chat
self.left_sidebar.on_click_new_chat = self.open_modal