Update app/callbacks.py
Browse files- app/callbacks.py +2 -1
app/callbacks.py
CHANGED
|
@@ -14,7 +14,8 @@ class LogResponseCallback(BaseCallbackHandler):
|
|
| 14 |
|
| 15 |
def on_llm_end(self, outputs: Dict[str, Any], **kwargs: Any) -> Any:
|
| 16 |
"""Run when chain ends running."""
|
| 17 |
-
|
|
|
|
| 18 |
crud.add_message(self.db, message, self.user_request.username)
|
| 19 |
|
| 20 |
def on_llm_start(
|
|
|
|
| 14 |
|
| 15 |
def on_llm_end(self, outputs: Dict[str, Any], **kwargs: Any) -> Any:
|
| 16 |
"""Run when chain ends running."""
|
| 17 |
+
llm_response = outputs.generations[0][0].text
|
| 18 |
+
message = schemas.MessageBase(message=llm_response, type='AI')
|
| 19 |
crud.add_message(self.db, message, self.user_request.username)
|
| 20 |
|
| 21 |
def on_llm_start(
|