[Docs] Documentation updates (#1014)
This commit is contained in:
@@ -650,7 +650,7 @@ class EmbedChain(JSONSerializable):
|
||||
self.db.reset()
|
||||
self.cursor.execute("DELETE FROM data_sources WHERE pipeline_id = ?", (self.config.id,))
|
||||
self.connection.commit()
|
||||
self.delete_history()
|
||||
self.delete_chat_history()
|
||||
# Send anonymous telemetry
|
||||
self.telemetry.capture(event_name="reset", properties=self._telemetry_props)
|
||||
|
||||
@@ -661,5 +661,6 @@ class EmbedChain(JSONSerializable):
|
||||
display_format=display_format,
|
||||
)
|
||||
|
||||
def delete_history(self):
|
||||
def delete_chat_history(self):
|
||||
self.llm.memory.delete_chat_history(app_id=self.config.id)
|
||||
self.llm.update_history(app_id=self.config.id)
|
||||
|
||||
@@ -48,8 +48,7 @@ class BaseLlm(JSONSerializable):
|
||||
def update_history(self, app_id: str):
|
||||
"""Update class history attribute with history in memory (for chat method)"""
|
||||
chat_history = self.memory.get_recent_memories(app_id=app_id, num_rounds=10)
|
||||
if chat_history:
|
||||
self.set_history([str(history) for history in chat_history])
|
||||
self.set_history([str(history) for history in chat_history])
|
||||
|
||||
def add_history(self, app_id: str, question: str, answer: str, metadata: Optional[Dict[str, Any]] = None):
|
||||
chat_message = ChatMessage()
|
||||
|
||||
Reference in New Issue
Block a user