Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -161,15 +161,8 @@ async def save_chat_history(history: dict):
|
|
| 161 |
hist = ''.join([f"'{entry['sender']}: {entry['message']}'\n" for entry in history['history']])
|
| 162 |
hist = "You are a Redfernstech summarize model. Your aim is to use this conversation to identify user interests solely based on that conversation: " + hist
|
| 163 |
print(hist)
|
| 164 |
-
|
| 165 |
# Get the summarized result from the client model
|
| 166 |
-
result = hist
|
| 167 |
-
|
| 168 |
-
try:
|
| 169 |
-
sf.Lead.update(user_id, {'Description': result})
|
| 170 |
-
except Exception as e:
|
| 171 |
-
return {"error": f"Failed to update lead: {str(e)}"}, 500
|
| 172 |
-
|
| 173 |
return {"summary": result, "message": "Chat history saved"}
|
| 174 |
|
| 175 |
|
|
|
|
| 161 |
hist = ''.join([f"'{entry['sender']}: {entry['message']}'\n" for entry in history['history']])
|
| 162 |
hist = "You are a Redfernstech summarize model. Your aim is to use this conversation to identify user interests solely based on that conversation: " + hist
|
| 163 |
print(hist)
|
|
|
|
| 164 |
# Get the summarized result from the client model
|
| 165 |
+
result = hist
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
return {"summary": result, "message": "Chat history saved"}
|
| 167 |
|
| 168 |
|