From 53afe146b818342ec31b373f46a0bd94dc36a67a Mon Sep 17 00:00:00 2001 From: femto Date: Sun, 24 Sep 2023 14:18:03 +0800 Subject: [PATCH 1/2] fix ltm serialize_message --- metagpt/utils/serialize.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metagpt/utils/serialize.py b/metagpt/utils/serialize.py index ffafca8cd..943def839 100644 --- a/metagpt/utils/serialize.py +++ b/metagpt/utils/serialize.py @@ -4,7 +4,7 @@ import copy import pickle -from typing import Dict, List, Tuple +from typing import Dict, List from metagpt.actions.action_output import ActionOutput from metagpt.schema import Message @@ -38,7 +38,7 @@ def actionoutout_schema_to_mapping(schema: Dict) -> Dict: mapping[field] = (List[str], ...) elif property["type"] == "array" and property["items"]["type"] == "array": # here only consider the `Tuple[str, str]` situation - mapping[field] = (List[Tuple[str, str]], ...) + mapping[field] = (List[List[str]], ...) return mapping From 04cf32e1ac13b376fe8ff64db9ad26b92c59ee9d Mon Sep 17 00:00:00 2001 From: femto Date: Mon, 25 Sep 2023 13:36:34 +0800 Subject: [PATCH 2/2] fix ltm serialize_message --- metagpt/utils/serialize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metagpt/utils/serialize.py b/metagpt/utils/serialize.py index 943def839..124176fcb 100644 --- a/metagpt/utils/serialize.py +++ b/metagpt/utils/serialize.py @@ -37,7 +37,7 @@ def actionoutout_schema_to_mapping(schema: Dict) -> Dict: elif property["type"] == "array" and property["items"]["type"] == "string": mapping[field] = (List[str], ...) elif property["type"] == "array" and property["items"]["type"] == "array": - # here only consider the `Tuple[str, str]` situation + # here only consider the `List[List[str]]` situation mapping[field] = (List[List[str]], ...) return mapping