Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -76,15 +76,25 @@ if st.session_state.tech_messages and st.session_state.tech_messages[-1]["role"]
|
|
76 |
|
77 |
if isinstance(results, list):
|
78 |
for item in results:
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
except Exception as parse_error:
|
89 |
st.warning("๐ก Could not parse assistant response as JSON.")
|
90 |
break
|
|
|
76 |
|
77 |
if isinstance(results, list):
|
78 |
for item in results:
|
79 |
+
drawing_number = item.get("drawing_number")
|
80 |
+
discipline = item.get("discipline")
|
81 |
+
summary = item.get("summary")
|
82 |
+
images = item.get("images", [])
|
83 |
+
single_image = item.get("image")
|
84 |
+
question = item.get("question", None)
|
85 |
+
|
86 |
+
with st.container(border=True):
|
87 |
+
st.markdown(f"### ๐๏ธ {drawing_number} ({discipline})")
|
88 |
+
st.markdown(f"**Summary:** {summary}")
|
89 |
+
|
90 |
+
with st.expander("๐ View Drawing Details"):
|
91 |
+
if question:
|
92 |
+
st.markdown(f"**Question Match:** {question}")
|
93 |
+
if single_image:
|
94 |
+
st.image(single_image, caption=drawing_number)
|
95 |
+
elif images:
|
96 |
+
for i, img in enumerate(images, start=1):
|
97 |
+
st.image(img, caption=f"{drawing_number} โ Page {i}")
|
98 |
except Exception as parse_error:
|
99 |
st.warning("๐ก Could not parse assistant response as JSON.")
|
100 |
break
|