Skip to content

Commit 4eacc38

Browse files
committed
Minor fixes
1 parent 4602659 commit 4eacc38

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/pytgpt/console.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,9 @@ def do_settings(self, line):
484484
default=busy_bar.spin_index,
485485
type=click.IntRange(0, 3),
486486
)
487-
self.color = click.prompt("Response stdout font color", default=self.color or 'white')
487+
self.color = click.prompt(
488+
"Response stdout font color", default=self.color or "white"
489+
)
488490
self.code_theme = Prompt.ask(
489491
"Enter code_theme", choices=rich_code_themes, default=self.code_theme
490492
)

src/pytgpt/utils.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ def __init__(
9393
filepath (str, optional): Path to file containing conversation history. Defaults to None.
9494
update_file (bool, optional): Add new prompts and responses to the file. Defaults to True.
9595
"""
96-
# I was thinking of introducing offset so as to control payload size. (prompt)
97-
# What's your thought on that? Give a PR or raise an issue
9896
self.status = status
9997
self.max_tokens_to_sample = max_tokens
10098
self.chat_history = self.intro
@@ -103,8 +101,7 @@ def __init__(
103101
self.update_file = update_file
104102
self.history_offset = 10250
105103
self.prompt_allowance = 10
106-
if filepath:
107-
self.load_conversation(filepath, False)
104+
self.load_conversation(filepath, False) if filepath else None
108105

109106
def load_conversation(self, filepath: str, exists: bool = True) -> None:
110107
"""Load conversation into chat's history from .txt file
@@ -176,7 +173,7 @@ def update_chat_history(self, prompt: str, response: str) -> None:
176173
if self.file and self.update_file:
177174
with open(self.file, "a") as fh:
178175
fh.write(new_history)
179-
self.chat_history += new_history if self.status else ""
176+
self.chat_history += new_history
180177

181178

182179
class AwesomePrompts:
@@ -215,7 +212,7 @@ def get_acts(self):
215212
def update_prompts_from_online(self, override: bool = False):
216213
"""Download awesome-prompts and update existing ones if available
217214
args:
218-
override (bool, optional): Override existing contents in path
215+
override (bool, optional): Overwrite existing contents in path
219216
"""
220217
resp = {}
221218
if not self.__is_prompt_updated:

0 commit comments

Comments
 (0)