cyberandy commited on
Commit
134d55e
1 Parent(s): 6250865

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -10
app.py CHANGED
@@ -135,16 +135,21 @@ def main():
135
  # Parse the advanced analysis response
136
  analysis_data = parse_analysis(advanced_msg)
137
 
138
- # Display parsed data in a collapsible section
139
- with st.expander("Show Advanced Analysis"):
140
- st.write("### User Intent")
141
- st.write(analysis_data['user_intent'])
142
- st.write("### Follow-up Questions")
143
- for question in analysis_data['follow_up_questions']:
144
- st.write("- " + question)
145
- st.write("### Identified Entities")
146
- for entity_type, entities in analysis_data['entities'].items():
147
- st.write(f"**{entity_type.capitalize()}**: {', '.join(entities)}")
 
 
 
 
 
148
 
149
  # Display the sentiment in a collapsible section
150
  with st.expander("Show Sentiment"):
 
135
  # Parse the advanced analysis response
136
  analysis_data = parse_analysis(advanced_msg)
137
 
138
+ if "error" in analysis_data:
139
+ st.error("Error in analysis: " + analysis_data["error"])
140
+ if "details" in analysis_data:
141
+ st.error("Details: " + analysis_data["details"])
142
+ else:
143
+ # Display parsed data in a collapsible section
144
+ with st.expander("Show Advanced Analysis"):
145
+ st.write("### User Intent")
146
+ st.write(analysis_data['user_intent'])
147
+ st.write("### Follow-up Questions")
148
+ for question in analysis_data['follow_up_questions']:
149
+ st.write("- " + question)
150
+ st.write("### Identified Entities")
151
+ for entity_type, entities in analysis_data['entities'].items():
152
+ st.write(f"**{entity_type.capitalize()}**: {', '.join(entities)}")
153
 
154
  # Display the sentiment in a collapsible section
155
  with st.expander("Show Sentiment"):