[Feature] Add support for optionally fetch all chat history for app (#1249)

This commit is contained in:
Deshraj Yadav
2024-02-07 14:52:39 -08:00
committed by GitHub
parent 9fa368b114
commit 7ad4af250f
2 changed files with 13 additions and 3 deletions

View File

@@ -696,9 +696,19 @@ class EmbedChain(JSONSerializable):
# Send anonymous telemetry # Send anonymous telemetry
self.telemetry.capture(event_name="reset", properties=self._telemetry_props) self.telemetry.capture(event_name="reset", properties=self._telemetry_props)
def get_history(self, num_rounds: int = 10, display_format: bool = True, session_id: Optional[str] = "default"): def get_history(
self,
num_rounds: int = 10,
display_format: bool = True,
session_id: Optional[str] = "default",
fetch_all: bool = False,
):
history = self.llm.memory.get( history = self.llm.memory.get(
app_id=self.config.id, session_id=session_id, num_rounds=num_rounds, display_format=display_format app_id=self.config.id,
session_id=session_id,
num_rounds=num_rounds,
display_format=display_format,
fetch_all=fetch_all,
) )
return history return history

View File

@@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "embedchain" name = "embedchain"
version = "0.1.75" version = "0.1.76"
description = "Simplest open source retrieval(RAG) framework" description = "Simplest open source retrieval(RAG) framework"
authors = [ authors = [
"Taranjeet Singh <taranjeet@embedchain.ai>", "Taranjeet Singh <taranjeet@embedchain.ai>",