Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -115,10 +115,12 @@ def search_workflow(school_name_or_udise, tavily_url, tavily_key, use_tavily, us
|
|
| 115 |
|
| 116 |
|
| 117 |
with gr.Blocks() as demo:
|
| 118 |
-
gr.Markdown("
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
|
| 120 |
-
Enter a school name or a UDISE code and call KYS (UDISE) or your Tavily search endpoint.
|
| 121 |
-
")
|
| 122 |
|
| 123 |
with gr.Row():
|
| 124 |
inp = gr.Textbox(label="School name or UDISE code", placeholder="e.g. 123456789012 or 'Govt High School...'", lines=1)
|
|
@@ -134,9 +136,9 @@ Enter a school name or a UDISE code and call KYS (UDISE) or your Tavily search e
|
|
| 134 |
output_json = gr.JSON(label="Raw Tavily Output (JSON)")
|
| 135 |
tavily_table = gr.DataFrame(headers=None, label="Tavily results (table)")
|
| 136 |
|
| 137 |
-
gr.Markdown(
|
| 138 |
The dropdown will list all numeric tokens resembling UDISE codes found in Tavily's response. Choose any candidate (or edit the UDISE field) and click 'Lookup UDISE' to call KYS.")
|
| 139 |
-
suggestions_dropdown = gr.Dropdown(choices=[], label="UDISE candidates (from Tavily)
|
| 140 |
udise_input = gr.Textbox(label="UDISE to lookup (editable)", placeholder="Pick a candidate or type a UDISE code...", lines=1)
|
| 141 |
lookup_btn = gr.Button("Lookup UDISE (Call KYS)")
|
| 142 |
|
|
@@ -173,12 +175,12 @@ The dropdown will list all numeric tokens resembling UDISE codes found in Tavily
|
|
| 173 |
|
| 174 |
lookup_btn.click(on_lookup_udise, inputs=[udise_input], outputs=[kys_output_json, kys_table])
|
| 175 |
|
| 176 |
-
gr.Markdown(
|
| 177 |
-
**Notes:**
|
| 178 |
-
- Tavily results are attempted to be flattened into a table for easy scanning; complex nested structures will be shown as JSON above.
|
| 179 |
-
- The UDISE candidates dropdown contains numeric tokens heuristically detected in the Tavily response; you can select one to fill the UDISE field, edit it, or type a different code.
|
| 180 |
-
- The 'Search Tavily' button only queries Tavily and fills the table + suggestions; use 'Lookup UDISE' to call KYS for the chosen code.
|
| 181 |
-
|
| 182 |
|
| 183 |
if __name__ == "__main__":
|
| 184 |
demo.launch()
|
|
|
|
| 115 |
|
| 116 |
|
| 117 |
with gr.Blocks() as demo:
|
| 118 |
+
gr.Markdown("""
|
| 119 |
+
# Tavily + KYS Search (Hugging Face Space)
|
| 120 |
+
|
| 121 |
+
Enter a school name or a UDISE code and call KYS (UDISE) or your Tavily search endpoint.
|
| 122 |
+
""")
|
| 123 |
|
|
|
|
|
|
|
| 124 |
|
| 125 |
with gr.Row():
|
| 126 |
inp = gr.Textbox(label="School name or UDISE code", placeholder="e.g. 123456789012 or 'Govt High School...'", lines=1)
|
|
|
|
| 136 |
output_json = gr.JSON(label="Raw Tavily Output (JSON)")
|
| 137 |
tavily_table = gr.DataFrame(headers=None, label="Tavily results (table)")
|
| 138 |
|
| 139 |
+
gr.Markdown('''### UDISE candidates found in Tavily results
|
| 140 |
The dropdown will list all numeric tokens resembling UDISE codes found in Tavily's response. Choose any candidate (or edit the UDISE field) and click 'Lookup UDISE' to call KYS.")
|
| 141 |
+
suggestions_dropdown = gr.Dropdown(choices=[], label="UDISE candidates (from Tavily)''')
|
| 142 |
udise_input = gr.Textbox(label="UDISE to lookup (editable)", placeholder="Pick a candidate or type a UDISE code...", lines=1)
|
| 143 |
lookup_btn = gr.Button("Lookup UDISE (Call KYS)")
|
| 144 |
|
|
|
|
| 175 |
|
| 176 |
lookup_btn.click(on_lookup_udise, inputs=[udise_input], outputs=[kys_output_json, kys_table])
|
| 177 |
|
| 178 |
+
gr.Markdown('''---
|
| 179 |
+
**Notes:**
|
| 180 |
+
- Tavily results are attempted to be flattened into a table for easy scanning; complex nested structures will be shown as JSON above.
|
| 181 |
+
- The UDISE candidates dropdown contains numeric tokens heuristically detected in the Tavily response; you can select one to fill the UDISE field, edit it, or type a different code.
|
| 182 |
+
- The 'Search Tavily' button only queries Tavily and fills the table + suggestions; use 'Lookup UDISE' to call KYS for the chosen code.
|
| 183 |
+
''')
|
| 184 |
|
| 185 |
if __name__ == "__main__":
|
| 186 |
demo.launch()
|