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

fix bug in putting board message in prompt #340

Merged
merged 1 commit into from
May 13, 2024
Merged
Show file tree
Hide file tree
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
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