Skip to content
This repository was archived by the owner on May 7, 2024. It is now read-only.

Commit 4afc775

Browse files
committed
Fix various bard related bugs
1 parent 6726a36 commit 4afc775

File tree

7 files changed

+28
-20
lines changed

7 files changed

+28
-20
lines changed

GPTCLI/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "1.5.8"
1+
__version__ = "1.5.9"
22
__author__ = "Smartwa Caleb"
33
__repo__ = "https://github.com/Simatwa/gpt-cli"
44
__info__ = "Interact with ChatGPT and Bard at the terminal."

GPTCLI/addons.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,12 @@ def main(self) -> None:
228228
self.pdf.set_x((210 - self.pdf.get_string_width(__repo__)) / 2)
229229
self.pdf.cell(0, 10, __repo__)
230230
self.pdf.ln()
231-
self.pdf.set_font('Symbol',size=8)
232-
time_stamp = f'Lastly auto-edited : {datetime.today().strftime("%d-%b-%Y %H:%M:%S %s")}'
231+
self.pdf.set_font("Symbol", size=8)
232+
time_stamp = (
233+
f'Lastly auto-edited : {datetime.today().strftime("%d-%b-%Y %H:%M:%S %s")}'
234+
)
233235
self.pdf.set_x((210 - self.pdf.get_string_width(time_stamp)) / 2)
234-
self.pdf.cell(0,10,time_stamp)
236+
self.pdf.cell(0, 10, time_stamp)
235237
self.pdf.output("all-acts.pdf")
236238
logging.info("Contents saved to 'all-acts.pdf'")
237239

GPTCLI/bard.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from json import load
66
from time import sleep
77

8+
logging.getLogger("httpx").setLevel(logging.ERROR)
89

910
class Bard:
1011
def __init__(self, args: object):
@@ -60,4 +61,4 @@ def chat(self, prompt: str, stream: bool = True) -> str:
6061
def reset(self):
6162
self.active_link.async_chatbot.conversation_id = ""
6263
self.active_link.async_chatbot.response_id = ""
63-
self.active_link.async_chatbot.choice_id = ""
64+
self.active_link.async_chatbot.choice_id = ""

GPTCLI/gptcli.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -810,15 +810,15 @@ def do__font_color(self, line):
810810
else:
811811
self.apply_color()
812812
self.do__prompt(self.prompt_disp)
813-
813+
814814
@error_handler()
815815
def do__background_color(self, line):
816816
"""Sets background-color"""
817817
self.bcolor_dict[line.lower()]
818818
args.background_color = line.lower()
819819
self.apply_color()
820820
self.do__prompt(self.prompt_disp)
821-
821+
822822
@error_handler()
823823
def do__save(self, line):
824824
if gpt4:
@@ -833,46 +833,44 @@ def do__save(self, line):
833833
"presence_penalty",
834834
"frequency_penalty",
835835
"reply_count",
836-
)
836+
)
837837
chatbot.save(join_list(line), *all)
838838
else:
839839
chatbot.save_conversation(join_list(line))
840840
self.do__prompt(self.prompt_disp)
841-
841+
842842
@error_handler()
843843
def do__load(self, line):
844844
if gpt4:
845845
chatbot.load(join_list(line))
846846
else:
847847
chatbot.load_conversation(join_list(line))
848848
self.do__prompt(self.prompt_disp)
849-
849+
850850
@error_handler()
851851
def do__rollback(self, line):
852852
if line.isdigit():
853853
chatbot.rollback(int(line))
854854
self.do__prompt(self.prompt_disp)
855-
855+
856856
@error_handler()
857857
def do__reset(self, line):
858-
if any([args.bard,'--bard' in line]) and not '--gpt4' in line:
858+
if any([args.bard, "--bard" in line]) and not "--gpt4" in line:
859859
self.bard.reset()
860-
chat_gpt = 'Bard'
860+
chat_gpt = "Bard"
861861
else:
862862
if gpt4:
863863
chatbot.reset(system_prompt=args.system_prompt)
864864
else:
865865
chatbot.reset()
866-
chat_gpt = 'GPT'
867-
logging.info(f'Chat reset successfully - {chat_gpt}')
866+
chat_gpt = "GPT"
867+
logging.info(f"Chat reset successfully - {chat_gpt}")
868868
self.do__prompt(self.prompt_disp)
869869

870870
def do__help(self, line):
871871
from .helper import help
872872

873-
rich_print(
874-
Panel(Markdown(help),title='Help Info')
875-
)
873+
rich_print(Panel(Markdown(help), title="Help Info"))
876874
self.do__prompt(self.prompt_disp)
877875

878876
def do__exit(self, line):

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<h1 align="center">gpt-cli</h1>
22
<p align="center">
33
<a href="https://github.com/Simatwa/gpt-cli"><img src="https://img.shields.io/static/v1?logo=Github&label=Github&message=Passing&color=lime" alt="Gihtub"/></a>
4-
<a href="https://pypi.org/project/chatgpt4-cli/"><img src="https://img.shields.io/static/v1?label=Pypi&message=v1.5.8&color=green&logo=pypi" alt="Pypi"/>
4+
<a href="https://pypi.org/project/chatgpt4-cli/"><img src="https://img.shields.io/static/v1?label=Pypi&message=v1.5.9&color=green&logo=pypi" alt="Pypi"/>
55
<a href="https://wakatime.com/badge/github/Simatwa/gpt-cli"><img src="https://wakatime.com/badge/github/Simatwa/gpt-cli.svg" alt="wakatime"/></a>
66
<a href="#"><img src="https://img.shields.io/static/v1?label=License&message=MIT&color=green&logo=MIT" alt="license"/></a>
77
<a href="#"><img src="https://img.shields.io/static/v1?label=Development&message=Beta&color=Orange&logo=progress" alt="Progress"/></a>

docs/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,10 @@
5252
## v1.5.8
5353

5454
- Bard request error fixed
55+
56+
## v1.5.9
57+
58+
**What's new?**
59+
60+
- Bug fixed - *low `httpx` logging level* : *bard*
61+
- Bug fixed - *malfunctioning <kbd>reset</kbd> action* : *bard*

setup.py

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

3-
__version__ = "1.5.8"
3+
__version__ = "1.5.9"
44
__author__ = "Smartwa Caleb"
55
__repo__ = "https://github.com/Simatwa/gpt-cli"
66
__info__ = "Interact with ChatGPT and Bard at the terminal."

0 commit comments

Comments
 (0)