Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Tuple for message contents #11

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions data_to_paper/data_to_paper/conversation/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def pretty_repr(self, number: Optional[int] = None, conversation_name: str = '',
s += colored_text(sep * TEXT_WIDTH, text_color)
return s

def get_content_after_hiding_incomplete_code(self) -> (str, bool):
def get_content_after_hiding_incomplete_code(self) -> tuple[str, bool]:
"""
Detect if the message contains incomplete code.
"""
Expand All @@ -152,7 +152,7 @@ def get_number_of_tokens_in_context(self) -> int:
return 0
return count_number_of_tokens_in_message(self.context, self.get_llm_model())

def _get_triple_quote_formatted_content(self, with_header: bool = True) -> (str, bool):
def _get_triple_quote_formatted_content(self, with_header: bool = True) -> tuple[str, bool]:
content, is_incomplete_code = self.get_content_after_hiding_incomplete_code()
if self.role == Role.SYSTEM:
content = wrap_text_with_triple_quotes(content, 'system')
Expand Down Expand Up @@ -237,7 +237,7 @@ def get_code_diff(self) -> str:
diff = list(diff)[3:]
return '\n'.join(diff)

def get_content_after_hiding_incomplete_code(self) -> (str, bool):
def get_content_after_hiding_incomplete_code(self) -> tuple[str, bool]:
"""
Detect if the message contains incomplete code.
"""
Expand Down