pratikshahp
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -73,8 +73,13 @@ def process_disaster(disaster_type, severity, resources):
|
|
73 |
# Generate Mermaid code for graph visualization
|
74 |
mermaid_code = graph.get_graph().draw_mermaid()
|
75 |
|
76 |
-
# Return the response plan and
|
77 |
-
return
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
iface = gr.Interface(
|
80 |
fn=process_disaster,
|
@@ -100,11 +105,11 @@ iface = gr.Interface(
|
|
100 |
],
|
101 |
outputs=[
|
102 |
gr.Textbox(label="Generated Disaster Response Plan"),
|
103 |
-
gr.Markdown("
|
104 |
-
gr.Markdown(
|
105 |
-
gr.Markdown(label="Mermaid Graph Visualization")
|
106 |
],
|
107 |
title="Disaster Response Assistant",
|
108 |
)
|
109 |
|
110 |
-
iface.launch()
|
|
|
73 |
# Generate Mermaid code for graph visualization
|
74 |
mermaid_code = graph.get_graph().draw_mermaid()
|
75 |
|
76 |
+
# Return the response plan, placeholder markdown, the link, and the Mermaid visualization
|
77 |
+
return (
|
78 |
+
result["recommendation"],
|
79 |
+
"## Mermaid Graph",
|
80 |
+
"Check out this [mermaid link](https://mermaid.live/) to display a graph with the following data",
|
81 |
+
f"```mermaid\n{mermaid_code}\n```"
|
82 |
+
)
|
83 |
|
84 |
iface = gr.Interface(
|
85 |
fn=process_disaster,
|
|
|
105 |
],
|
106 |
outputs=[
|
107 |
gr.Textbox(label="Generated Disaster Response Plan"),
|
108 |
+
gr.Markdown(), # Placeholder for the "Mermaid Graph" heading
|
109 |
+
gr.Markdown(), # Placeholder for the link text
|
110 |
+
gr.Markdown(label="Mermaid Graph Visualization") # Mermaid visualization
|
111 |
],
|
112 |
title="Disaster Response Assistant",
|
113 |
)
|
114 |
|
115 |
+
iface.launch()
|