Improve manuals (#19)
* Rename Admin -> Resources * Improve ui * Update docs
This commit is contained in:
@@ -27,7 +27,7 @@ class ChatPage(BasePage):
|
||||
def on_building_ui(self):
|
||||
with gr.Row():
|
||||
self.chat_state = gr.State(STATE)
|
||||
with gr.Column(scale=1):
|
||||
with gr.Column(scale=1, elem_id="conv-settings-panel"):
|
||||
self.chat_control = ConversationControl(self._app)
|
||||
|
||||
if getattr(flowsettings, "KH_FEATURE_CHAT_SUGGESTION", False):
|
||||
@@ -60,7 +60,7 @@ class ChatPage(BasePage):
|
||||
|
||||
self.report_issue = ReportIssue(self._app)
|
||||
|
||||
with gr.Column(scale=6):
|
||||
with gr.Column(scale=6, elem_id="chat-area"):
|
||||
self.chat_panel = ChatPanel(self._app)
|
||||
|
||||
with gr.Column(scale=3):
|
||||
|
@@ -22,19 +22,20 @@ class ChatPanel(BasePage):
|
||||
placeholder="Chat input",
|
||||
scale=15,
|
||||
container=False,
|
||||
max_lines=10,
|
||||
)
|
||||
self.submit_btn = gr.Button(
|
||||
value="Send",
|
||||
scale=1,
|
||||
min_width=10,
|
||||
variant="primary",
|
||||
elem_classes=["cap-height"],
|
||||
elem_classes=["cap-button-height"],
|
||||
)
|
||||
self.regen_btn = gr.Button(
|
||||
value="Regen",
|
||||
scale=1,
|
||||
min_width=10,
|
||||
elem_classes=["cap-height"],
|
||||
elem_classes=["cap-button-height"],
|
||||
)
|
||||
|
||||
def submit_msg(self, chat_input, chat_history):
|
||||
|
@@ -37,6 +37,7 @@ class ConversationControl(BasePage):
|
||||
container=False,
|
||||
filterable=False,
|
||||
interactive=True,
|
||||
elem_classes=["unset-overflow"],
|
||||
)
|
||||
|
||||
with gr.Row() as self._new_delete:
|
||||
|
@@ -28,8 +28,10 @@ class ReportIssue(BasePage):
|
||||
label="Other issue:",
|
||||
)
|
||||
self.more_detail = gr.Textbox(
|
||||
placeholder="More detail (e.g. how wrong is it, what is the "
|
||||
"correct answer, etc...)",
|
||||
placeholder=(
|
||||
"More detail (e.g. how wrong is it, what is the "
|
||||
"correct answer, etc...)"
|
||||
),
|
||||
container=False,
|
||||
lines=3,
|
||||
)
|
||||
|
@@ -7,18 +7,15 @@ class HelpPage:
|
||||
def __init__(self, app):
|
||||
self._app = app
|
||||
self.dir_md = Path(__file__).parent.parent / "assets" / "md"
|
||||
self.doc_dir = Path(__file__).parents[4] / "docs"
|
||||
|
||||
with gr.Accordion("User Guide"):
|
||||
with (self.doc_dir / "usage.md").open(encoding="utf-8") as fi:
|
||||
gr.Markdown(fi.read())
|
||||
|
||||
with gr.Accordion("Changelogs"):
|
||||
gr.Markdown(self.get_changelogs())
|
||||
|
||||
with gr.Accordion("About Kotaemon (temporary)"):
|
||||
with (self.dir_md / "about_kotaemon.md").open(encoding="utf-8") as fi:
|
||||
gr.Markdown(fi.read())
|
||||
|
||||
with gr.Accordion("About Cinnamon AI (temporary)", open=False):
|
||||
with (self.dir_md / "about_cinnamon.md").open(encoding="utf-8") as fi:
|
||||
gr.Markdown(fi.read())
|
||||
|
||||
def get_changelogs(self):
|
||||
with (self.dir_md / "changelogs.md").open(encoding="utf-8") as fi:
|
||||
return fi.read()
|
||||
|
@@ -8,7 +8,7 @@ from sqlmodel import Session, select
|
||||
from .user import UserManagement
|
||||
|
||||
|
||||
class AdminPage(BasePage):
|
||||
class ResourcesTab(BasePage):
|
||||
def __init__(self, app):
|
||||
self._app = app
|
||||
self.on_building_ui()
|
||||
@@ -21,7 +21,7 @@ class AdminPage(BasePage):
|
||||
with gr.Tab("LLMs") as self.llm_management_tab:
|
||||
self.llm_management = LLMManagement(self._app)
|
||||
|
||||
with gr.Tab("Embeddings") as self.llm_management_tab:
|
||||
with gr.Tab("Embedding Models") as self.llm_management_tab:
|
||||
self.emb_management = EmbeddingManagement(self._app)
|
||||
|
||||
def on_subscribe_public_events(self):
|
Reference in New Issue
Block a user