From 7ad4af250f322b6bff7de5923d47a687057ef309 Mon Sep 17 00:00:00 2001 From: Deshraj Yadav Date: Wed, 7 Feb 2024 14:52:39 -0800 Subject: [PATCH] [Feature] Add support for optionally fetch all chat history for app (#1249) --- embedchain/embedchain.py | 14 ++++++++++++-- pyproject.toml | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/embedchain/embedchain.py b/embedchain/embedchain.py index 3f9a6000..173e7928 100644 --- a/embedchain/embedchain.py +++ b/embedchain/embedchain.py @@ -696,9 +696,19 @@ class EmbedChain(JSONSerializable): # Send anonymous telemetry 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( - 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 diff --git a/pyproject.toml b/pyproject.toml index cb0c488c..2c93221c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "embedchain" -version = "0.1.75" +version = "0.1.76" description = "Simplest open source retrieval(RAG) framework" authors = [ "Taranjeet Singh ",