Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -154,12 +154,14 @@ def send_to_salesforce(violations, score):
|
|
| 154 |
'Violations_Details__c': "\n".join([f"Frame {v['frame']}: {v['violation']} (Confidence: {v['confidence']})" for v in violations]),
|
| 155 |
}
|
| 156 |
|
|
|
|
| 157 |
try:
|
| 158 |
-
#
|
| 159 |
-
sf.
|
| 160 |
-
print("✅ Successfully
|
| 161 |
except Exception as e:
|
| 162 |
-
print(f"❌ Error updating Salesforce: {e}")
|
|
|
|
| 163 |
|
| 164 |
# ==========================
|
| 165 |
# Gradio Interface
|
|
|
|
| 154 |
'Violations_Details__c': "\n".join([f"Frame {v['frame']}: {v['violation']} (Confidence: {v['confidence']})" for v in violations]),
|
| 155 |
}
|
| 156 |
|
| 157 |
+
|
| 158 |
try:
|
| 159 |
+
# Insert new record in Salesforce
|
| 160 |
+
result = sf.Safety_Video_Report__c.create(data)
|
| 161 |
+
print(f"✅ Successfully created new report in Salesforce with ID: {result['id']}")
|
| 162 |
except Exception as e:
|
| 163 |
+
print(f"❌ Error creating/updating record in Salesforce: {e}")
|
| 164 |
+
|
| 165 |
|
| 166 |
# ==========================
|
| 167 |
# Gradio Interface
|