fix unit tests for tool module

This commit is contained in:
yzlin 2024-03-11 16:18:28 +08:00
parent bff3ef02bc
commit b5af9ccde6
7 changed files with 91 additions and 141 deletions

View file

@ -42,9 +42,7 @@ class WritePlan(Action):
"""
async def run(self, context: list[Message], max_tasks: int = 5, use_tools: bool = False) -> str:
task_type_desc = "\n".join(
[f"- **{tt.type_name}**: {tt.value.desc}" for tt in TaskType]
) # task type are binded with tool type now, should be improved in the future
task_type_desc = "\n".join([f"- **{tt.type_name}**: {tt.value.desc}" for tt in TaskType])
prompt = self.PROMPT_TEMPLATE.format(
context="\n".join([str(ct) for ct in context]), max_tasks=max_tasks, task_type_desc=task_type_desc
)