From 242ebb1b7f11ff1ed5a07221f68f90b95d2c1a0f Mon Sep 17 00:00:00 2001 From: better629 Date: Tue, 9 Jan 2024 10:15:05 +0800 Subject: [PATCH 1/2] update breakpoint_recovery due to serialize using one single file --- .../in_depth_guides/breakpoint_recovery.md | 211 +++++++++--------- .../in_depth_guides/breakpoint_recovery.md | 210 +++++++++-------- 2 files changed, 200 insertions(+), 221 deletions(-) diff --git a/src/en/guide/in_depth_guides/breakpoint_recovery.md b/src/en/guide/in_depth_guides/breakpoint_recovery.md index 56cae7f8..aa5939c5 100644 --- a/src/en/guide/in_depth_guides/breakpoint_recovery.md +++ b/src/en/guide/in_depth_guides/breakpoint_recovery.md @@ -18,84 +18,59 @@ In order to support breakpoint recovery operations, the output of different modu ### Serialized storage structure -In order to clarify the structural information of the overall serialized project, a hierarchical approach is used to serialize and store the content. +In order to reduce the impact of subsequent new functions on the storage structure, an "integrated" single json file is used for storage. -When the program is interrupted, the file structure corresponding to different modules in the storage directory is as follows: - -Structure summary +When the program is interrupted or terminated, the file structure in the storage directory is as follows: ```bash ./workspace storage team - team_info.json # team idea and investment - environment # environment - roles.json # role basic info of the team - history.json # 历史信息 - roles # 团队内角色 - RoleA_Alice # 具体一个角色 - memory.json # 角色记忆 - role_info.json # 包括角色身份、执行动作、监听动作等信息 + team.json # Contains information such as team, environment, roles, actions, etc. ``` -Under each `xxx.json` is a data summary example of the corresponding content. - -```bash -./workspace - storage - team - team_info.json # investment and so on - { - "investment": 10.0, - "idea": "write a snake game" - } - environment - roles.json # roles' meta info - [ - { - "role_class": "RoleA", - "module_name": "tests.metagpt.serialize_deserialize.test_serdeser_base", - "role_name": "RoleA" - }, - { - "role_class": "RoleB", - "module_name": "tests.metagpt.serialize_deserialize.test_serdeser_base", - "role_name": "RoleB" - } - ] - history.json - { - "content": "\nHuman: write a snake game\nRole A: ActionPass run passed\nHuman: write a snake game" - } - roles - ProductManager_Alice - memory.json - { - "storage": [ - { - "id": "70a3450d0d5c4900afefe7e8d60f3c65", - "content": "ActionPass run passed", - "instruct_content": { - "class": "pass", - "mapping": { - "result": "(, Ellipsis)" - }, - "value": { - "result": "pass result" - } - }, - "role": "Role A", - "cause_by": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionPass", - "sent_from": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleA", - "send_to": [ - "" - ] - } - ], - "index": { - "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionPass": [ +Example of data summary corresponding to `team.json`. + +```json +{ + "env": { + "desc": "", + "roles": { + "Role A": { + }, + "Role B": { + "name": "RoleB", + "profile": "Role B", + "goal": "RoleB's goal", + "constraints": "RoleB's constraints", + "desc": "", + "is_human": false, + "role_id": "", + "states": [ + "0. ", + "1. " + ], + "actions": [ + { + "name": "ActionOK", + "context": "", + "prefix": "You are a Role B, named RoleB, your goal is RoleB's goal. the constraint is RoleB's constraints. ", + "desc": "", + "__module_class_name": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionOK" + }, + { + "name": "ActionRaise", + "context": "", + "prefix": "You are a Role B, named RoleB, your goal is RoleB's goal. the constraint is RoleB's constraints. ", + "desc": "", + "__module_class_name": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionRaise" + } + ], + "rc": { + "memory": { + "storage": [ { - "id": "70a3450d0d5c4900afefe7e8d60f3c65", + "id": "7cc01798c3324c6c8b676d282ea9e92c", "content": "ActionPass run passed", "instruct_content": { "class": "pass", @@ -106,56 +81,70 @@ Under each `xxx.json` is a data summary example of the corresponding content. "result": "pass result" } }, - "role": "Role A", + "role": "RoleA(Role A)", "cause_by": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionPass", "sent_from": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleA", "send_to": [ "" ] - } - ] - } - } - role_info.json # RoleSetting _actions _states - { - "name": "RoleA", - "profile": "Role A", - "goal": "RoleA's goal", - "constraints": "RoleA's constraints", - "desc": "", - "is_human": false, - "recovered": true, - "builtin_class_name": "RoleA", - "_role_id": "RoleA(Role A)", - "_states": [ - "0. " - ], - "_actions": [ - { - "name": "", - "builtin_class_name": "ActionPass", - "context": "", - "prefix": "You are a Role A, named RoleA, your goal is RoleA's goal, and the constraint is RoleA's constraints. ", - "profile": "Role A", - "desc": "", - "nodes": [] - } - ], - "_rc": { - "state": -1, - "watch": [ - "metagpt.actions.add_requirement.UserRequirement" + }, ], - "react_mode": "react", - "max_react_loop": 1 + "index": { + "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionOK": [ + { + "id": "018bde1d4bdb4e9387c1053da0dc0cb3", + "content": "ok", + "instruct_content": null, + "role": "Role B", + "cause_by": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionOK", + "sent_from": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleB", + "send_to": [ + "" + ] + } + ] + }, + "ignore_id": false }, - "_subscription": [ - "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleA", - "RoleA" + "state": 1, + "watch": [ + "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionPass" ], - "role_class": "RoleA", - "module_name": "tests.metagpt.serialize_deserialize.test_serdeser_base" - } + "react_mode": "by_order", + "max_react_loop": 1 + }, + "addresses": [ + "RoleB", + "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleB" + ], + "recovered": true, + "latest_observed_msg": { + "id": "7cc01798c3324c6c8b676d282ea9e92c", + "content": "ActionPass run passed", + "instruct_content": { + "class": "pass", + "mapping": { + "result": "(, Ellipsis)" + }, + "value": { + "result": "pass result" + } + }, + "role": "RoleA(Role A)", + "cause_by": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionPass", + "sent_from": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleA", + "send_to": [ + "" + ] + }, + "__module_class_name": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleB" + } + }, + "history": "\nHuman: write a snake game\nRoleA(Role A): {'result': 'pass result'}\nHuman: write a snake game" + }, + "investment": 10.0, + "idea": "write a snake game" +} ``` ### Execution order during recovery diff --git a/src/zh/guide/in_depth_guides/breakpoint_recovery.md b/src/zh/guide/in_depth_guides/breakpoint_recovery.md index 8d402989..650a8d60 100644 --- a/src/zh/guide/in_depth_guides/breakpoint_recovery.md +++ b/src/zh/guide/in_depth_guides/breakpoint_recovery.md @@ -18,83 +18,59 @@ ### 序列化存储结构 -为了清晰化**整体项目的结构信息**,采用层级化的方式进行内容的序列化存储。 +为了减少后续新增功能对存储结构的影响,使用“一体化“的单json文件进行存储。 -当程序发生中断后,对应不同模块在存储目录下的文件结构如下: -结构概要 +当程序发生中断或结束后,在存储目录下的文件结构如下: ```bash ./workspace storage team - team_info.json # 团队需求、预算等信息 - environment # 环境 - roles.json # 团队内的角色基础信息 - history.json # 历史信息 - roles # 团队内角色 - RoleA_Alice # 具体一个角色 - memory.json # 角色记忆 - role_info.json # 包括角色身份、执行动作、监听动作等信息 + team.json # 包含团队、环境、角色、动作等信息 ``` -每个`xxx.json`下的为对应内容的数据概要示例。 - -```bash -./workspace - storage - team - team_info.json # investment and so on - { - "investment": 10.0, - "idea": "write a snake game" - } - environment - roles.json # roles' meta info - [ - { - "role_class": "RoleA", - "module_name": "tests.metagpt.serialize_deserialize.test_serdeser_base", - "role_name": "RoleA" - }, - { - "role_class": "RoleB", - "module_name": "tests.metagpt.serialize_deserialize.test_serdeser_base", - "role_name": "RoleB" - } - ] - history.json - { - "content": "\nHuman: write a snake game\nRole A: ActionPass run passed\nHuman: write a snake game" - } - roles - ProductManager_Alice - memory.json - { - "storage": [ - { - "id": "70a3450d0d5c4900afefe7e8d60f3c65", - "content": "ActionPass run passed", - "instruct_content": { - "class": "pass", - "mapping": { - "result": "(, Ellipsis)" - }, - "value": { - "result": "pass result" - } - }, - "role": "Role A", - "cause_by": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionPass", - "sent_from": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleA", - "send_to": [ - "" - ] - } - ], - "index": { - "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionPass": [ +`team.json`对应内容的数据概要示例。 + +```json +{ + "env": { + "desc": "", + "roles": { + "Role A": { + }, + "Role B": { + "name": "RoleB", + "profile": "Role B", + "goal": "RoleB's goal", + "constraints": "RoleB's constraints", + "desc": "", + "is_human": false, + "role_id": "", + "states": [ + "0. ", + "1. " + ], + "actions": [ + { + "name": "ActionOK", + "context": "", + "prefix": "You are a Role B, named RoleB, your goal is RoleB's goal. the constraint is RoleB's constraints. ", + "desc": "", + "__module_class_name": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionOK" + }, + { + "name": "ActionRaise", + "context": "", + "prefix": "You are a Role B, named RoleB, your goal is RoleB's goal. the constraint is RoleB's constraints. ", + "desc": "", + "__module_class_name": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionRaise" + } + ], + "rc": { + "memory": { + "storage": [ { - "id": "70a3450d0d5c4900afefe7e8d60f3c65", + "id": "7cc01798c3324c6c8b676d282ea9e92c", "content": "ActionPass run passed", "instruct_content": { "class": "pass", @@ -105,56 +81,70 @@ "result": "pass result" } }, - "role": "Role A", + "role": "RoleA(Role A)", "cause_by": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionPass", "sent_from": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleA", "send_to": [ "" ] - } - ] - } - } - role_info.json # RoleSetting _actions _states - { - "name": "RoleA", - "profile": "Role A", - "goal": "RoleA's goal", - "constraints": "RoleA's constraints", - "desc": "", - "is_human": false, - "recovered": true, - "builtin_class_name": "RoleA", - "_role_id": "RoleA(Role A)", - "_states": [ - "0. " - ], - "_actions": [ - { - "name": "", - "builtin_class_name": "ActionPass", - "context": "", - "prefix": "You are a Role A, named RoleA, your goal is RoleA's goal, and the constraint is RoleA's constraints. ", - "profile": "Role A", - "desc": "", - "nodes": [] - } - ], - "_rc": { - "state": -1, - "watch": [ - "metagpt.actions.add_requirement.UserRequirement" + }, ], - "react_mode": "react", - "max_react_loop": 1 + "index": { + "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionOK": [ + { + "id": "018bde1d4bdb4e9387c1053da0dc0cb3", + "content": "ok", + "instruct_content": null, + "role": "Role B", + "cause_by": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionOK", + "sent_from": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleB", + "send_to": [ + "" + ] + } + ] + }, + "ignore_id": false }, - "_subscription": [ - "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleA", - "RoleA" + "state": 1, + "watch": [ + "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionPass" ], - "role_class": "RoleA", - "module_name": "tests.metagpt.serialize_deserialize.test_serdeser_base" - } + "react_mode": "by_order", + "max_react_loop": 1 + }, + "addresses": [ + "RoleB", + "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleB" + ], + "recovered": true, + "latest_observed_msg": { + "id": "7cc01798c3324c6c8b676d282ea9e92c", + "content": "ActionPass run passed", + "instruct_content": { + "class": "pass", + "mapping": { + "result": "(, Ellipsis)" + }, + "value": { + "result": "pass result" + } + }, + "role": "RoleA(Role A)", + "cause_by": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionPass", + "sent_from": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleA", + "send_to": [ + "" + ] + }, + "__module_class_name": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleB" + } + }, + "history": "\nHuman: write a snake game\nRoleA(Role A): {'result': 'pass result'}\nHuman: write a snake game" + }, + "investment": 10.0, + "idea": "write a snake game" +} ``` ### 恢复时的执行顺序 From a5a220550879c57e3df3dd564834f635f8bc7f6a Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 02:17:09 +0000 Subject: [PATCH 2/2] [autofix.ci] apply automated fixes --- .../in_depth_guides/breakpoint_recovery.md | 211 +++++++++--------- .../in_depth_guides/breakpoint_recovery.md | 211 +++++++++--------- 2 files changed, 204 insertions(+), 218 deletions(-) diff --git a/src/en/guide/in_depth_guides/breakpoint_recovery.md b/src/en/guide/in_depth_guides/breakpoint_recovery.md index aa5939c5..f64b6fcf 100644 --- a/src/en/guide/in_depth_guides/breakpoint_recovery.md +++ b/src/en/guide/in_depth_guides/breakpoint_recovery.md @@ -18,9 +18,9 @@ In order to support breakpoint recovery operations, the output of different modu ### Serialized storage structure -In order to reduce the impact of subsequent new functions on the storage structure, an "integrated" single json file is used for storage. +In order to reduce the impact of subsequent new functions on the storage structure, an "integrated" single json file is used for storage. -When the program is interrupted or terminated, the file structure in the storage directory is as follows: +When the program is interrupted or terminated, the file structure in the storage directory is as follows: ```bash ./workspace @@ -29,121 +29,114 @@ When the program is interrupted or terminated, the file structure in the storage team.json # Contains information such as team, environment, roles, actions, etc. ``` -Example of data summary corresponding to `team.json`. +Example of data summary corresponding to `team.json`. ```json { - "env": { + "env": { + "desc": "", + "roles": { + "Role A": {}, + "Role B": { + "name": "RoleB", + "profile": "Role B", + "goal": "RoleB's goal", + "constraints": "RoleB's constraints", "desc": "", - "roles": { - "Role A": { - }, - "Role B": { - "name": "RoleB", - "profile": "Role B", - "goal": "RoleB's goal", - "constraints": "RoleB's constraints", - "desc": "", - "is_human": false, - "role_id": "", - "states": [ - "0. ", - "1. " - ], - "actions": [ - { - "name": "ActionOK", - "context": "", - "prefix": "You are a Role B, named RoleB, your goal is RoleB's goal. the constraint is RoleB's constraints. ", - "desc": "", - "__module_class_name": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionOK" - }, - { - "name": "ActionRaise", - "context": "", - "prefix": "You are a Role B, named RoleB, your goal is RoleB's goal. the constraint is RoleB's constraints. ", - "desc": "", - "__module_class_name": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionRaise" - } - ], - "rc": { - "memory": { - "storage": [ - { - "id": "7cc01798c3324c6c8b676d282ea9e92c", - "content": "ActionPass run passed", - "instruct_content": { - "class": "pass", - "mapping": { - "result": "(, Ellipsis)" - }, - "value": { - "result": "pass result" - } - }, - "role": "RoleA(Role A)", - "cause_by": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionPass", - "sent_from": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleA", - "send_to": [ - "" - ] - }, - ], - "index": { - "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionOK": [ - { - "id": "018bde1d4bdb4e9387c1053da0dc0cb3", - "content": "ok", - "instruct_content": null, - "role": "Role B", - "cause_by": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionOK", - "sent_from": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleB", - "send_to": [ - "" - ] - } - ] - }, - "ignore_id": false - }, - "state": 1, - "watch": [ - "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionPass" - ], - "react_mode": "by_order", - "max_react_loop": 1 - }, - "addresses": [ - "RoleB", - "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleB" - ], - "recovered": true, - "latest_observed_msg": { - "id": "7cc01798c3324c6c8b676d282ea9e92c", - "content": "ActionPass run passed", - "instruct_content": { - "class": "pass", - "mapping": { - "result": "(, Ellipsis)" - }, - "value": { - "result": "pass result" - } - }, - "role": "RoleA(Role A)", - "cause_by": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionPass", - "sent_from": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleA", - "send_to": [ - "" - ] + "is_human": false, + "role_id": "", + "states": [ + "0. ", + "1. " + ], + "actions": [ + { + "name": "ActionOK", + "context": "", + "prefix": "You are a Role B, named RoleB, your goal is RoleB's goal. the constraint is RoleB's constraints. ", + "desc": "", + "__module_class_name": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionOK" + }, + { + "name": "ActionRaise", + "context": "", + "prefix": "You are a Role B, named RoleB, your goal is RoleB's goal. the constraint is RoleB's constraints. ", + "desc": "", + "__module_class_name": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionRaise" + } + ], + "rc": { + "memory": { + "storage": [ + { + "id": "7cc01798c3324c6c8b676d282ea9e92c", + "content": "ActionPass run passed", + "instruct_content": { + "class": "pass", + "mapping": { + "result": "(, Ellipsis)" + }, + "value": { + "result": "pass result" + } }, - "__module_class_name": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleB" + "role": "RoleA(Role A)", + "cause_by": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionPass", + "sent_from": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleA", + "send_to": [""] + } + ], + "index": { + "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionOK": [ + { + "id": "018bde1d4bdb4e9387c1053da0dc0cb3", + "content": "ok", + "instruct_content": null, + "role": "Role B", + "cause_by": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionOK", + "sent_from": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleB", + "send_to": [""] + } + ] + }, + "ignore_id": false + }, + "state": 1, + "watch": [ + "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionPass" + ], + "react_mode": "by_order", + "max_react_loop": 1 + }, + "addresses": [ + "RoleB", + "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleB" + ], + "recovered": true, + "latest_observed_msg": { + "id": "7cc01798c3324c6c8b676d282ea9e92c", + "content": "ActionPass run passed", + "instruct_content": { + "class": "pass", + "mapping": { + "result": "(, Ellipsis)" + }, + "value": { + "result": "pass result" } + }, + "role": "RoleA(Role A)", + "cause_by": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionPass", + "sent_from": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleA", + "send_to": [""] }, - "history": "\nHuman: write a snake game\nRoleA(Role A): {'result': 'pass result'}\nHuman: write a snake game" + "__module_class_name": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleB" + } }, - "investment": 10.0, - "idea": "write a snake game" + "history": "\nHuman: write a snake game\nRoleA(Role A): {'result': 'pass result'}\nHuman: write a snake game" + }, + "investment": 10.0, + "idea": "write a snake game" } ``` diff --git a/src/zh/guide/in_depth_guides/breakpoint_recovery.md b/src/zh/guide/in_depth_guides/breakpoint_recovery.md index 650a8d60..7a6245d6 100644 --- a/src/zh/guide/in_depth_guides/breakpoint_recovery.md +++ b/src/zh/guide/in_depth_guides/breakpoint_recovery.md @@ -18,9 +18,9 @@ ### 序列化存储结构 -为了减少后续新增功能对存储结构的影响,使用“一体化“的单json文件进行存储。 +为了减少后续新增功能对存储结构的影响,使用“一体化“的单json文件进行存储。 -当程序发生中断或结束后,在存储目录下的文件结构如下: +当程序发生中断或结束后,在存储目录下的文件结构如下: ```bash ./workspace @@ -29,121 +29,114 @@ team.json # 包含团队、环境、角色、动作等信息 ``` -`team.json`对应内容的数据概要示例。 +`team.json`对应内容的数据概要示例。 ```json { - "env": { + "env": { + "desc": "", + "roles": { + "Role A": {}, + "Role B": { + "name": "RoleB", + "profile": "Role B", + "goal": "RoleB's goal", + "constraints": "RoleB's constraints", "desc": "", - "roles": { - "Role A": { - }, - "Role B": { - "name": "RoleB", - "profile": "Role B", - "goal": "RoleB's goal", - "constraints": "RoleB's constraints", - "desc": "", - "is_human": false, - "role_id": "", - "states": [ - "0. ", - "1. " - ], - "actions": [ - { - "name": "ActionOK", - "context": "", - "prefix": "You are a Role B, named RoleB, your goal is RoleB's goal. the constraint is RoleB's constraints. ", - "desc": "", - "__module_class_name": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionOK" - }, - { - "name": "ActionRaise", - "context": "", - "prefix": "You are a Role B, named RoleB, your goal is RoleB's goal. the constraint is RoleB's constraints. ", - "desc": "", - "__module_class_name": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionRaise" - } - ], - "rc": { - "memory": { - "storage": [ - { - "id": "7cc01798c3324c6c8b676d282ea9e92c", - "content": "ActionPass run passed", - "instruct_content": { - "class": "pass", - "mapping": { - "result": "(, Ellipsis)" - }, - "value": { - "result": "pass result" - } - }, - "role": "RoleA(Role A)", - "cause_by": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionPass", - "sent_from": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleA", - "send_to": [ - "" - ] - }, - ], - "index": { - "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionOK": [ - { - "id": "018bde1d4bdb4e9387c1053da0dc0cb3", - "content": "ok", - "instruct_content": null, - "role": "Role B", - "cause_by": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionOK", - "sent_from": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleB", - "send_to": [ - "" - ] - } - ] - }, - "ignore_id": false - }, - "state": 1, - "watch": [ - "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionPass" - ], - "react_mode": "by_order", - "max_react_loop": 1 - }, - "addresses": [ - "RoleB", - "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleB" - ], - "recovered": true, - "latest_observed_msg": { - "id": "7cc01798c3324c6c8b676d282ea9e92c", - "content": "ActionPass run passed", - "instruct_content": { - "class": "pass", - "mapping": { - "result": "(, Ellipsis)" - }, - "value": { - "result": "pass result" - } - }, - "role": "RoleA(Role A)", - "cause_by": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionPass", - "sent_from": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleA", - "send_to": [ - "" - ] + "is_human": false, + "role_id": "", + "states": [ + "0. ", + "1. " + ], + "actions": [ + { + "name": "ActionOK", + "context": "", + "prefix": "You are a Role B, named RoleB, your goal is RoleB's goal. the constraint is RoleB's constraints. ", + "desc": "", + "__module_class_name": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionOK" + }, + { + "name": "ActionRaise", + "context": "", + "prefix": "You are a Role B, named RoleB, your goal is RoleB's goal. the constraint is RoleB's constraints. ", + "desc": "", + "__module_class_name": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionRaise" + } + ], + "rc": { + "memory": { + "storage": [ + { + "id": "7cc01798c3324c6c8b676d282ea9e92c", + "content": "ActionPass run passed", + "instruct_content": { + "class": "pass", + "mapping": { + "result": "(, Ellipsis)" + }, + "value": { + "result": "pass result" + } }, - "__module_class_name": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleB" + "role": "RoleA(Role A)", + "cause_by": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionPass", + "sent_from": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleA", + "send_to": [""] + } + ], + "index": { + "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionOK": [ + { + "id": "018bde1d4bdb4e9387c1053da0dc0cb3", + "content": "ok", + "instruct_content": null, + "role": "Role B", + "cause_by": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionOK", + "sent_from": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleB", + "send_to": [""] + } + ] + }, + "ignore_id": false + }, + "state": 1, + "watch": [ + "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionPass" + ], + "react_mode": "by_order", + "max_react_loop": 1 + }, + "addresses": [ + "RoleB", + "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleB" + ], + "recovered": true, + "latest_observed_msg": { + "id": "7cc01798c3324c6c8b676d282ea9e92c", + "content": "ActionPass run passed", + "instruct_content": { + "class": "pass", + "mapping": { + "result": "(, Ellipsis)" + }, + "value": { + "result": "pass result" } + }, + "role": "RoleA(Role A)", + "cause_by": "tests.metagpt.serialize_deserialize.test_serdeser_base.ActionPass", + "sent_from": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleA", + "send_to": [""] }, - "history": "\nHuman: write a snake game\nRoleA(Role A): {'result': 'pass result'}\nHuman: write a snake game" + "__module_class_name": "tests.metagpt.serialize_deserialize.test_serdeser_base.RoleB" + } }, - "investment": 10.0, - "idea": "write a snake game" + "history": "\nHuman: write a snake game\nRoleA(Role A): {'result': 'pass result'}\nHuman: write a snake game" + }, + "investment": 10.0, + "idea": "write a snake game" } ```