mirror of
https://github.com/TheR1D/shell_gpt.git
synced 2026-06-02 06:14:32 +02:00
Minor lint fixes
This commit is contained in:
+2
-2
@@ -238,7 +238,7 @@ def main(
|
||||
functions=function_schemas,
|
||||
)
|
||||
|
||||
session = PromptSession()
|
||||
session: PromptSession[str] = PromptSession()
|
||||
|
||||
while shell and interaction:
|
||||
option = typer.prompt(
|
||||
@@ -252,7 +252,7 @@ def main(
|
||||
# "y" option is for keeping compatibility with old version.
|
||||
run_command(full_completion)
|
||||
elif option == "m":
|
||||
full_completion = session.prompt('', default=full_completion)
|
||||
full_completion = session.prompt("", default=full_completion)
|
||||
continue
|
||||
elif option == "d":
|
||||
DefaultHandler(DefaultRoles.DESCRIBE_SHELL.get_role(), md).handle(
|
||||
|
||||
@@ -72,7 +72,9 @@ class ChatSession:
|
||||
def _write(self, messages: List[Dict[str, str]], chat_id: str) -> None:
|
||||
file_path = self.storage_path / chat_id
|
||||
# Retain the first message since it defines the role
|
||||
truncated_messages = messages[:1] + messages[1 + max(0, len(messages) - self.length):]
|
||||
truncated_messages = (
|
||||
messages[:1] + messages[1 + max(0, len(messages) - self.length) :]
|
||||
)
|
||||
json.dump(truncated_messages, file_path.open("w"))
|
||||
|
||||
def invalidate(self, chat_id: str) -> None:
|
||||
|
||||
Reference in New Issue
Block a user