Spaces:
Sleeping
Sleeping
oceansweep
commited on
Commit
•
7b2538d
1
Parent(s):
56e6fb5
Update App_Function_Libraries/Gradio_UI/Search_Tab.py
Browse files
App_Function_Libraries/Gradio_UI/Search_Tab.py
CHANGED
@@ -126,6 +126,32 @@ def create_viewing_tab():
|
|
126 |
)
|
127 |
|
128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
def create_search_summaries_tab():
|
130 |
with gr.TabItem("Search/View Title+Summary "):
|
131 |
gr.Markdown("# Search across all ingested items in the Database and review their summaries")
|
|
|
126 |
)
|
127 |
|
128 |
|
129 |
+
def create_search_tab():
|
130 |
+
with gr.TabItem("Search / Detailed View"):
|
131 |
+
with gr.Row():
|
132 |
+
with gr.Column():
|
133 |
+
gr.Markdown("# Search across all ingested items in the Database")
|
134 |
+
gr.Markdown(" by Title / URL / Keyword / or Content via SQLite Full-Text-Search")
|
135 |
+
search_query_input = gr.Textbox(label="Search Query", placeholder="Enter your search query here...")
|
136 |
+
search_type_input = gr.Radio(choices=["Title", "URL", "Keyword", "Content"], value="Title", label="Search By")
|
137 |
+
search_button = gr.Button("Search")
|
138 |
+
items_output = gr.Dropdown(label="Select Item", choices=[])
|
139 |
+
item_mapping = gr.State({})
|
140 |
+
prompt_summary_output = gr.HTML(label="Prompt & Summary", visible=True)
|
141 |
+
|
142 |
+
search_button.click(
|
143 |
+
fn=update_dropdown,
|
144 |
+
inputs=[search_query_input, search_type_input],
|
145 |
+
outputs=[items_output, item_mapping]
|
146 |
+
)
|
147 |
+
with gr.Column():
|
148 |
+
content_output = gr.Markdown(label="Content", visible=True)
|
149 |
+
items_output.change(
|
150 |
+
fn=update_detailed_view,
|
151 |
+
inputs=[items_output, item_mapping],
|
152 |
+
outputs=[prompt_summary_output, content_output]
|
153 |
+
)
|
154 |
+
|
155 |
def create_search_summaries_tab():
|
156 |
with gr.TabItem("Search/View Title+Summary "):
|
157 |
gr.Markdown("# Search across all ingested items in the Database and review their summaries")
|