diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 76e53f0..2363528 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -524,4 +524,10 @@ For instance: **What's new?** - feat: Override chat intro. -- Other minor fixes. \ No newline at end of file +- Other minor fixes. + +## v0.6.7 + +**What's new?** + +- fix: Failure to include intro in chat history - from `v0.6.6` \ No newline at end of file diff --git a/setup.py b/setup.py index 291f3f1..bbdc8d7 100644 --- a/setup.py +++ b/setup.py @@ -47,7 +47,7 @@ setup( name="python-tgpt", - version="0.6.7", + version="0.6.8", license="MIT", author="Smartwa", maintainer="Smartwa", diff --git a/src/pytgpt/gpt4free/utils.py b/src/pytgpt/gpt4free/utils.py index 9bc1954..dc3bbac 100644 --- a/src/pytgpt/gpt4free/utils.py +++ b/src/pytgpt/gpt4free/utils.py @@ -151,7 +151,9 @@ def main( # Create a progress bar total = len(self.working_providers) with Progress() as progress: - self.__log(20, f"Testing {total} providers : {', '.join(self.working_providers)}") + self.__log( + 20, f"Testing {total} providers : {', '.join(self.working_providers)}" + ) task = progress.add_task( f"[cyan]Testing...[{self.test_at_once}]", total=total, diff --git a/src/pytgpt/utils.py b/src/pytgpt/utils.py index 3bc100c..85513ae 100644 --- a/src/pytgpt/utils.py +++ b/src/pytgpt/utils.py @@ -199,9 +199,9 @@ def __trim_chat_history(self, chat_history: str, intro: str = None) -> str: new_chat_history = chat_history[truncate_at:] self.chat_history = intro + "\n... " + new_chat_history # print(len(self.chat_history)) - return self.chat_history - # print(len(chat_history)) - return chat_history + else: + self.chat_history = intro + chat_history + return self.chat_history def gen_complete_prompt(self, prompt: str, intro: str = None) -> str: """Generates a kinda like incomplete conversation