Minor lint fixes

This commit is contained in:
Farkhod Sadykov
2025-07-17 04:19:16 +02:00
parent 30f39782b0
commit 9615dfbec8
2 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -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(
+3 -1
View File
@@ -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: