Skip to content

Commit

Permalink
fix bug in formatting (#402)
Browse files Browse the repository at this point in the history
Make sure placeholder is in the text.
  • Loading branch information
ShilinHe authored Sep 11, 2024
2 parents aa23765 + 16e1f80 commit af4be11
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def compose_prompt(
return chat_history

def format_attachment(self, attachment: Attachment):
if attachment.type == AttachmentType.thought:
if attachment.type == AttachmentType.thought and "{ROLE_NAME}" in attachment.content:
return attachment.content.format(ROLE_NAME=self.role_name)
else:
return attachment.content
Expand Down
1 change: 1 addition & 0 deletions taskweaver/memory/attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class AttachmentType(Enum):

# Misc
invalid_response = "invalid_response"
text = "text"

# board info
board = "board"
Expand Down

0 comments on commit af4be11

Please sign in to comment.