Skip to content

Commit bab60bb

Browse files
committed
- Bug fixed - *reset conversation* - **bard**
- Bug fixed - *low `httpx` logging level*. - **bard**
1 parent fe2f3b9 commit bab60bb

File tree

6 files changed

+21
-4
lines changed

6 files changed

+21
-4
lines changed

docs/CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,11 @@
136136

137137
- New provider : [Bard](https://github.com/acheong08/bard) by **Google**.
138138
- Check whole last response
139-
- Othetr minor fixes.
139+
- Other minor fixes.
140+
141+
## v0.2.6
142+
143+
**What's new?**
144+
145+
- Bug fixed - *reset conversation* - **bard**
146+
- Bug fixed - *low `httpx` logging level*. - **bard**

docs/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<a href="https://github.com/Simatwa/python-tgpt/actions/workflows/python-test.yml"><img src="https://github.com/Simatwa/python-tgpt/actions/workflows/python-test.yml/badge.svg" alt="Python Test"/></a>
99
-->
1010
<a href="https://github.com/Simatwa/python-tgpt/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/static/v1?logo=GPL&color=Blue&message=MIT&label=License"/></a>
11-
<a href="https://pypi.org/project/python-tgpt"><img alt="PyPi" src="https://img.shields.io/static/v1?logo=pypi&label=Pypi&message=0.2.5&color=green"/></a>
11+
<a href="https://pypi.org/project/python-tgpt"><img alt="PyPi" src="https://img.shields.io/static/v1?logo=pypi&label=Pypi&message=0.2.6&color=green"/></a>
1212
<a href="https://github.com/psf/black"><img alt="Black" src="https://img.shields.io/static/v1?logo=Black&label=Code-style&message=Black"/></a>
1313
<a href="#"><img alt="Passing" src="https://img.shields.io/static/v1?logo=Docs&label=Docs&message=Passing&color=green"/></a>
1414
<a href="https://github.com/Simatwa/python-tgpt/actions/workflows/python-package.yml"><img src="https://github.com/Simatwa/python-tgpt/actions/workflows/python-package.yml/badge.svg"/></a>
@@ -311,6 +311,8 @@ bot = koboldai.KOBOLDAI(is_conversation=False)
311311

312312
Utilize the `--disable-conversation` flag in the console to achieve the same functionality.
313313

314+
> **Warning** : **Bard** and **WebChatGPT** autohandles context due to the obvious reason; the `is_conversation` parameter is not necessary at all hence not required when initializing the respective classes.
315+
314316
For more usage info run `$ pytgpt --help`
315317

316318

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
setup(
1616
name="python-tgpt",
17-
version="0.2.5",
17+
version="0.2.6",
1818
license="MIT",
1919
author="Smartwa",
2020
maintainer="Smartwa",

src/pytgpt/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from .utils import appdir
22

3-
__version__ = "0.2.5"
3+
__version__ = "0.2.6"
44
__author__ = "Smartwa"
55
__repo__ = "https://github.com/Simatwa/python-tgpt"
66

src/pytgpt/bard/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,9 @@ def get_message(self, response: dict) -> str:
181181
"""
182182
assert isinstance(response, dict), "Response should be of dict data-type only"
183183
return response["content"]
184+
185+
def reset(self):
186+
"""Reset the current conversation"""
187+
self.session.async_chatbot.conversation_id = ""
188+
self.session.async_chatbot.response_id = ""
189+
self.session.async_chatbot.choice_id = ""

src/pytgpt/console.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,8 @@ def do_reset(self, line):
593593
self.bot.conversation.chat_history = click.prompt(
594594
"Introductory prompt", default=self.bot.conversation.intro
595595
)
596+
if hasattr(self.bot, "reset"):
597+
self.bot.reset()
596598
click.secho("Conversation reset successfully. New one created.", fg="cyan")
597599

598600
@busy_bar.run("while loading conversation")

0 commit comments

Comments
 (0)