Skip to content

Commit

Permalink
- Bug fixed - *reset conversation* - **bard**
Browse files Browse the repository at this point in the history
- Bug fixed - *low `httpx` logging level*. - **bard**
  • Loading branch information
Simatwa committed Jan 16, 2024
1 parent fe2f3b9 commit bab60bb
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 4 deletions.
9 changes: 8 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,11 @@

- New provider : [Bard](https://github.com/acheong08/bard) by **Google**.
- Check whole last response
- Othetr minor fixes.
- Other minor fixes.

## v0.2.6

**What's new?**

- Bug fixed - *reset conversation* - **bard**
- Bug fixed - *low `httpx` logging level*. - **bard**
4 changes: 3 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<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>
-->
<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>
<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>
<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>
<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>
<a href="#"><img alt="Passing" src="https://img.shields.io/static/v1?logo=Docs&label=Docs&message=Passing&color=green"/></a>
<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>
Expand Down Expand Up @@ -311,6 +311,8 @@ bot = koboldai.KOBOLDAI(is_conversation=False)

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

> **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.
For more usage info run `$ pytgpt --help`


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

setup(
name="python-tgpt",
version="0.2.5",
version="0.2.6",
license="MIT",
author="Smartwa",
maintainer="Smartwa",
Expand Down
2 changes: 1 addition & 1 deletion src/pytgpt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .utils import appdir

__version__ = "0.2.5"
__version__ = "0.2.6"
__author__ = "Smartwa"
__repo__ = "https://github.com/Simatwa/python-tgpt"

Expand Down
6 changes: 6 additions & 0 deletions src/pytgpt/bard/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,9 @@ def get_message(self, response: dict) -> str:
"""
assert isinstance(response, dict), "Response should be of dict data-type only"
return response["content"]

def reset(self):
"""Reset the current conversation"""
self.session.async_chatbot.conversation_id = ""
self.session.async_chatbot.response_id = ""
self.session.async_chatbot.choice_id = ""
2 changes: 2 additions & 0 deletions src/pytgpt/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,8 @@ def do_reset(self, line):
self.bot.conversation.chat_history = click.prompt(
"Introductory prompt", default=self.bot.conversation.intro
)
if hasattr(self.bot, "reset"):
self.bot.reset()
click.secho("Conversation reset successfully. New one created.", fg="cyan")

@busy_bar.run("while loading conversation")
Expand Down

0 comments on commit bab60bb

Please # to comment.