Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -126,7 +126,12 @@ def process_ticket(issue_description: str):
|
|
| 126 |
result = graph.invoke(state)
|
| 127 |
response = result.get("response", "No response generated")
|
| 128 |
escalation = result.get("escalation", "No escalation specified")
|
| 129 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
except Exception as e:
|
| 131 |
return f"Error occurred: {e}", "Unable to determine escalation"
|
| 132 |
|
|
@@ -137,6 +142,9 @@ iface = gr.Interface(
|
|
| 137 |
outputs=[
|
| 138 |
gr.Textbox(label="Response"),
|
| 139 |
gr.Textbox(label="Escalation Decision"),
|
|
|
|
|
|
|
|
|
|
| 140 |
],
|
| 141 |
title="Ticket Handling System",
|
| 142 |
)
|
|
|
|
| 126 |
result = graph.invoke(state)
|
| 127 |
response = result.get("response", "No response generated")
|
| 128 |
escalation = result.get("escalation", "No escalation specified")
|
| 129 |
+
mermaid_code = graph.get_graph().draw_mermaid()
|
| 130 |
+
|
| 131 |
+
return response, escalation,"## Mermaid Graph",
|
| 132 |
+
"Check out this [mermaid link](https://mermaid.live/) to display a graph with the following data",
|
| 133 |
+
f"```mermaid\n{mermaid_code}\n```"
|
| 134 |
+
|
| 135 |
except Exception as e:
|
| 136 |
return f"Error occurred: {e}", "Unable to determine escalation"
|
| 137 |
|
|
|
|
| 142 |
outputs=[
|
| 143 |
gr.Textbox(label="Response"),
|
| 144 |
gr.Textbox(label="Escalation Decision"),
|
| 145 |
+
gr.Markdown(), # Placeholder for the "Mermaid Graph" heading
|
| 146 |
+
gr.Markdown(), # Placeholder for the link text
|
| 147 |
+
gr.Markdown(label="Mermaid Graph Visualization") # Mermaid visualization
|
| 148 |
],
|
| 149 |
title="Ticket Handling System",
|
| 150 |
)
|