Update app.py
Browse files
app.py
CHANGED
|
@@ -1,2 +1,68 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from streamlit_cytoscapejs import cytoscape
|
| 3 |
+
|
| 4 |
+
st.set_page_config(page_title="GenAI Claims Workflow", layout="wide")
|
| 5 |
+
st.title("GenAI Claims Automation Workflow")
|
| 6 |
+
|
| 7 |
+
# Define the workflow steps and edges
|
| 8 |
+
nodes = [
|
| 9 |
+
{"data": {"id": "lodged", "label": "1. Claim Lodged"}},
|
| 10 |
+
{"data": {"id": "fraud", "label": "2. Fraud Check"}},
|
| 11 |
+
{"data": {"id": "coverage", "label": "3. Coverage Check"}},
|
| 12 |
+
{"data": {"id": "builder", "label": "4. Builder Assignment"}},
|
| 13 |
+
{"data": {"id": "schedule", "label": "5. Schedule Repairs"}},
|
| 14 |
+
{"data": {"id": "payment", "label": "6. Authorise Payment"}},
|
| 15 |
+
{"data": {"id": "settle", "label": "7. Settle Claim"}},
|
| 16 |
+
]
|
| 17 |
+
|
| 18 |
+
edges = [
|
| 19 |
+
{"data": {"source": "lodged", "target": "fraud"}},
|
| 20 |
+
{"data": {"source": "fraud", "target": "coverage"}},
|
| 21 |
+
{"data": {"source": "coverage", "target": "builder"}},
|
| 22 |
+
{"data": {"source": "builder", "target": "schedule"}},
|
| 23 |
+
{"data": {"source": "schedule", "target": "payment"}},
|
| 24 |
+
{"data": {"source": "payment", "target": "settle"}},
|
| 25 |
+
]
|
| 26 |
+
|
| 27 |
+
# Combine into elements
|
| 28 |
+
elements = nodes + edges
|
| 29 |
+
|
| 30 |
+
# Render the graph
|
| 31 |
+
selected_node = cytoscape(
|
| 32 |
+
elements=elements,
|
| 33 |
+
layout_name="breadthfirst", # Options: grid, circle, breadthfirst
|
| 34 |
+
height="500px",
|
| 35 |
+
style={
|
| 36 |
+
"node": {
|
| 37 |
+
"label": "data(label)",
|
| 38 |
+
"background-color": "#0077B6",
|
| 39 |
+
"text-valign": "center",
|
| 40 |
+
"text-halign": "center",
|
| 41 |
+
"color": "white",
|
| 42 |
+
"font-size": "14px",
|
| 43 |
+
"width": "label",
|
| 44 |
+
"height": "label",
|
| 45 |
+
"padding": "10px",
|
| 46 |
+
"border-color": "#023E8A",
|
| 47 |
+
"border-width": "2px",
|
| 48 |
+
}
|
| 49 |
+
},
|
| 50 |
+
)
|
| 51 |
+
|
| 52 |
+
# Show step details
|
| 53 |
+
step_details = {
|
| 54 |
+
"lodged": "The claim is received via the customer portal. If more info is needed, an email is sent.",
|
| 55 |
+
"fraud": "LLM checks for fraud patterns using historic claims and language cues.",
|
| 56 |
+
"coverage": "The policy is evaluated to check coverage eligibility using claim metadata.",
|
| 57 |
+
"builder": "Based on the location and nature of damage, an approved builder is assigned.",
|
| 58 |
+
"schedule": "The repair is scheduled by coordinating between the builder and customer.",
|
| 59 |
+
"payment": "The system authorises payment to builder after repair progress is validated.",
|
| 60 |
+
"settle": "Final review is done, and the claim is marked as settled in the system."
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
if selected_node:
|
| 64 |
+
st.subheader(f"Details for: {selected_node}")
|
| 65 |
+
st.success(step_details.get(selected_node, "No info available."))
|
| 66 |
+
else:
|
| 67 |
+
st.info("Click a node to view details about that step.")
|
| 68 |
+
|