Skip to content

Commit

Permalink
fix bug in putting board message in prompt (#340)
Browse files Browse the repository at this point in the history
put 'board' attachments in the ignored type during prompt composing.
  • Loading branch information
liqul authored May 13, 2024
1 parent 51c60dc commit 0abfd23
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion taskweaver/memory/attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class AttachmentType(Enum):
# Misc
invalid_response = "invalid_response"

# board infor
# board info
board = "board"


Expand Down
4 changes: 4 additions & 0 deletions taskweaver/role/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ def post_to_raw_text(
:param ignored_types:
:return: str
"""
if ignored_types is None:
ignored_types = []
ignored_types.append(AttachmentType.board)

structured_llm: List[Dict[str, str]] = []
for attachment in post.attachment_list:
attachments_dict = {}
Expand Down
7 changes: 6 additions & 1 deletion tests/unit_tests/test_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ def test_compose_prompt():
message="Please load the data file /home/data.csv and count the rows of the loaded data",
send_from="Planner",
send_to="CodeInterpreter",
attachment_list=[],
attachment_list=[
Attachment.create(
AttachmentType.board,
"1. load the data file\n2. count the rows of the loaded data <narrow depend on 1>\n",
),
],
)
post2.add_attachment(
Attachment.create(
Expand Down

0 comments on commit 0abfd23

Please sign in to comment.