Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -179,8 +179,10 @@ async def save_chat_history(history: dict):
|
|
| 179 |
api_name="/chat"
|
| 180 |
)
|
| 181 |
|
| 182 |
-
|
| 183 |
-
|
|
|
|
|
|
|
| 184 |
|
| 185 |
return {"summary": result, "message": "Chat history saved"}
|
| 186 |
@app.post("/webhook")
|
|
|
|
| 179 |
api_name="/chat"
|
| 180 |
)
|
| 181 |
|
| 182 |
+
try:
|
| 183 |
+
sf.Lead.update(user_id, {'Description': result})
|
| 184 |
+
except Exception as e:
|
| 185 |
+
return {"error": f"Failed to update lead: {str(e)}"}, 500
|
| 186 |
|
| 187 |
return {"summary": result, "message": "Chat history saved"}
|
| 188 |
@app.post("/webhook")
|