diff --git a/im_client/agents/tools/wikidata.py b/im_client/agents/tools/wikidata.py index 96dad3c..e50a797 100644 --- a/im_client/agents/tools/wikidata.py +++ b/im_client/agents/tools/wikidata.py @@ -140,7 +140,7 @@ def _item_to_document(self, qid: str) -> Optional[str]: doc_lines.append(f"Aliases: {', '.join(resp.aliases)}") for prop, values in resp.statements.items(): if values: - doc_lines.append(f"{prop.label}: {', '.join(values)}") + doc_lines.append(f"{prop.label}: {', '.join(map(str, values))}") return "\n".join(doc_lines)[: self.doc_content_chars_max] # return Document( diff --git a/im_client/communication/task_management.py b/im_client/communication/task_management.py index 108e26d..8255b19 100644 --- a/im_client/communication/task_management.py +++ b/im_client/communication/task_management.py @@ -299,7 +299,7 @@ def set_triggers(self, task_identifiers: list[int] | list[str], trigger_setter: if task: if task.status.priority < TaskStatus.COMPLETED.priority: - logger.info(f"Set {task.task_id}'s trigger") + logger.info(f"Task status: {task.status.priority}. Set {task.task_id}'s trigger") self.triggers[task.task_id] = False else: logger.info(f"{task.task_id} is in terminated status. Skip setting trigger.") @@ -360,7 +360,7 @@ def update_triggers(self, task_identifiers: list[int] | list[str], trigger_sette if task: if task.status.priority < TaskStatus.COMPLETED.priority: # not in terminated status - logger.info(f"Set {task_id}'s trigger") + logger.info(f"Task status: {task.status.priority}. Set {task_id}'s trigger") self.triggers[task.task_id] = False else: logger.info(f"{task_id} is in terminated status. Skip setting trigger.") @@ -448,12 +448,12 @@ def from_dict(data: dict) -> TaskManager: for task_id, (task_index, task_entry_dict) in data["tasks"].items() } manager.taskIndex2tasks = { - index: TaskEntry.from_dict(task_entry_dict) for index, task_entry_dict in data["taskIndex2tasks"].items() + index: entry for _, (index, entry) in manager.tasks.items() } manager.triggers = data["triggers"] manager.trigger_setter = data["trigger_setter"] manager.msg2task = { - LLMResult.model_validate_json(result_json): TaskEntry.from_dict(task_dict) + LLMResult.model_validate_json(result_json): manager.tasks[TaskEntry.from_dict(task_dict).task_id][1] for result_json, task_dict in data["msg2task"].items() } manager.dynamic_collaborative_planner = data["dynamic_collaborative_planner"]