From bc494b2d2705fb21d580c09b607f2c9831e0e2c5 Mon Sep 17 00:00:00 2001 From: better629 Date: Wed, 27 Mar 2024 23:07:46 +0800 Subject: [PATCH] rename folder --- .../test_memory/kw_strength.json | 4 --- .../associative_memory/embeddings.json | 1 - .../associative_memory/nodes.json | 1 - .../{st_game => stanford_town}/.gitignore | 0 examples/{st_game => stanford_town}/README.md | 4 +-- .../{st_game => stanford_town}/README_CN.md | 4 +-- .../{st_game => stanford_town}/__init__.py | 0 .../actions/__init__.py | 0 .../actions/agent_chat_sum_rel.py | 2 +- .../actions/decide_to_talk.py | 2 +- .../actions/dummy_action.py | 0 .../actions/gen_action_details.py | 2 +- .../actions/gen_daily_schedule.py | 0 .../actions/gen_hourly_schedule.py | 0 .../actions/gen_iter_chat_utt.py | 6 ++-- .../actions/inner_voice_action.py | 2 +- .../actions/new_decomp_schedule.py | 2 +- .../actions/run_reflect_action.py | 2 +- .../actions/st_action.py | 2 +- .../actions/summarize_conv.py | 2 +- .../actions/task_decomp.py | 0 .../actions/wake_up.py | 0 .../memory/__init__.py | 0 .../memory/agent_memory.py | 0 .../memory/retrieve.py | 4 +-- .../memory/scratch.py | 0 .../memory/spatial_memory.py | 0 .../plan/__init__.py | 0 .../plan/converse.py | 6 ++-- .../plan/st_plan.py | 0 .../prompts/__init__.py | 0 .../prompts/action_location_object_vMar11.txt | 0 .../prompts/action_location_sector_v1.txt | 0 .../prompts/action_object_v2.txt | 0 .../prompts/daily_planning_v6.txt | 0 .../prompts/decide_to_talk_v2.txt | 0 .../prompts/generate_event_triple_v1.txt | 0 .../prompts/generate_focal_pt_v1.txt | 0 .../prompts/generate_hourly_schedule_v2.txt | 0 .../prompts/generate_obj_event_v1.txt | 0 .../prompts/generate_pronunciatio_v1.txt | 0 .../prompts/insight_and_evidence_v1.txt | 0 .../prompts/iterative_convo_v1.txt | 0 .../prompts/memo_on_convo_v1.txt | 0 .../prompts/new_decomp_schedule_v1.txt | 0 .../prompts/planning_thought_on_convo_v1.txt | 0 .../prompts/poignancy_action_v1.txt | 0 .../prompts/poignancy_chat_v1.txt | 0 .../prompts/poignancy_event_v1.txt | 0 .../prompts/poignancy_thought_v1.txt | 0 .../summarize_chat_relationship_v2.txt | 0 .../prompts/summarize_conversation_v1.txt | 0 .../prompts/task_decomp_v3.txt | 0 .../prompts/wake_up_hour_v1.txt | 0 .../prompts/whisper_inner_thought_v1.txt | 0 .../reflect/__init__.py | 0 .../reflect/reflect.py | 6 ++-- .../requirements.txt | 0 .../roles/__init__.py | 0 .../roles/st_role.py | 28 +++++++++---------- .../{st_game => stanford_town}/run_st_game.py | 10 +++---- .../stanford_town.py | 6 ++-- .../the_ville/agent_history_init_n25.csv | 0 .../the_ville/agent_history_init_n3.csv | 0 .../the_ville/matrix/maze/arena_maze.csv | 0 .../the_ville/matrix/maze/collision_maze.csv | 0 .../matrix/maze/game_object_maze.csv | 0 .../the_ville/matrix/maze/sector_maze.csv | 0 .../matrix/maze/spawning_location_maze.csv | 0 .../the_ville/matrix/maze_meta_info.json | 0 .../matrix/special_blocks/arena_blocks.csv | 0 .../special_blocks/game_object_blocks.csv | 0 .../matrix/special_blocks/sector_blocks.csv | 0 .../spawning_location_blocks.csv | 0 .../matrix/special_blocks/world_blocks.csv | 0 .../storage/.gitignore | 0 .../environment/0.json | 0 .../associative_memory/embeddings.json | 0 .../associative_memory/kw_strength.json | 0 .../associative_memory/nodes.json | 0 .../bootstrap_memory/scratch.json | 0 .../bootstrap_memory/spatial_memory.json | 0 .../associative_memory}/embeddings.json | 0 .../associative_memory/kw_strength.json | 0 .../associative_memory}/nodes.json | 0 .../bootstrap_memory/scratch.json | 0 .../bootstrap_memory/spatial_memory.json | 0 .../associative_memory/embeddings.json | 0 .../associative_memory/kw_strength.json | 0 .../associative_memory/nodes.json | 0 .../Maria Lopez/bootstrap_memory/scratch.json | 0 .../bootstrap_memory/spatial_memory.json | 0 .../reverie/meta.json | 0 .../tests/__init__.py | 0 .../tests/actions/__init__.py | 0 .../tests/actions/test_gen_action_details.py | 8 +++--- .../tests/actions/test_summarize_conv.py | 2 +- .../tests/plan/__init__.py | 0 .../tests/plan/test_conversation.py | 12 ++++---- .../tests/plan/test_st_plan.py | 8 ++++-- .../tests/roles/__init__.py | 0 .../tests/roles/test_st_role.py | 8 +++--- .../tests/test_agent_memory.py | 6 ++-- .../tests/test_basic_memory.py | 2 +- .../tests/test_reflect.py | 8 +++--- .../tests/test_spatial_memory.py | 0 .../utils/__init__.py | 0 .../{st_game => stanford_town}/utils/const.py | 0 .../utils/mg_ga_transform.py | 2 +- .../{st_game => stanford_town}/utils/utils.py | 0 metagpt/environment/__init__.py | 8 +++--- .../{android_env => android}/__init__.py | 0 .../{android_env => android}/android_env.py | 2 +- .../android_ext_env.py | 2 +- .../{android_env => android}/const.py | 0 .../{minecraft_env => minecraft}/__init__.py | 0 .../{minecraft_env => minecraft}/const.py | 0 .../minecraft_env.py | 4 +-- .../minecraft_ext_env.py | 6 ++-- .../mineflayer/.gitignore | 0 .../mineflayer/.prettierignore | 0 .../mineflayer/.prettierrc.json | 0 .../mineflayer/index.js | 0 .../mineflayer/lib/observation/base.js | 0 .../mineflayer/lib/observation/chests.js | 0 .../mineflayer/lib/observation/inventory.js | 0 .../mineflayer/lib/observation/onChat.js | 0 .../mineflayer/lib/observation/onError.js | 0 .../mineflayer/lib/observation/onSave.js | 0 .../mineflayer/lib/observation/status.js | 0 .../mineflayer/lib/observation/voxels.js | 0 .../mineflayer/lib/skillLoader.js | 0 .../mineflayer/lib/utils.js | 0 .../mineflayer-collectblock/.gitignore | 0 .../mineflayer-collectblock/LICENSE | 0 .../mineflayer-collectblock/README.md | 0 .../mineflayer-collectblock/_config.yml | 0 .../mineflayer-collectblock/docs/api.md | 0 .../examples/collector.js | 0 .../examples/oreMiner.js | 0 .../examples/storageBot.js | 0 .../mineflayer-collectblock/package.json | 0 .../mineflayer-collectblock/src/BlockVeins.ts | 0 .../src/CollectBlock.ts | 0 .../mineflayer-collectblock/src/Inventory.ts | 0 .../mineflayer-collectblock/src/Targets.ts | 0 .../mineflayer-collectblock/src/TaskQueue.ts | 0 .../src/TemporarySubscriber.ts | 0 .../mineflayer-collectblock/src/Util.ts | 0 .../mineflayer-collectblock/src/index.ts | 0 .../mineflayer-collectblock/tsconfig.json | 0 .../mineflayer/package.json | 0 .../process_monitor.py | 0 .../{software_env => software}/__init__.py | 0 .../software_env.py | 0 .../__init__.py | 0 .../env_space.py | 0 .../stanford_town_env.py | 4 +-- .../stanford_town_ext_env.py | 2 +- .../{werewolf_env => werewolf}/__init__.py | 0 .../werewolf_env.py | 2 +- .../werewolf_ext_env.py | 0 .../android_env/test_android_ext_env.py | 22 ++++++--------- .../minecraft_env/test_minecraft_ext_env.py | 4 +-- .../test_stanford_town_ext_env.py | 10 +++---- .../werewolf_env/test_werewolf_ext_env.py | 2 +- 166 files changed, 105 insertions(+), 115 deletions(-) delete mode 100644 examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/test_memory/kw_strength.json delete mode 100644 examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/associative_memory/embeddings.json delete mode 100644 examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/associative_memory/nodes.json rename examples/{st_game => stanford_town}/.gitignore (100%) rename examples/{st_game => stanford_town}/README.md (77%) rename examples/{st_game => stanford_town}/README_CN.md (77%) rename examples/{st_game => stanford_town}/__init__.py (100%) rename examples/{st_game => stanford_town}/actions/__init__.py (100%) rename examples/{st_game => stanford_town}/actions/agent_chat_sum_rel.py (95%) rename examples/{st_game => stanford_town}/actions/decide_to_talk.py (98%) rename examples/{st_game => stanford_town}/actions/dummy_action.py (100%) rename examples/{st_game => stanford_town}/actions/gen_action_details.py (99%) rename examples/{st_game => stanford_town}/actions/gen_daily_schedule.py (100%) rename examples/{st_game => stanford_town}/actions/gen_hourly_schedule.py (100%) rename examples/{st_game => stanford_town}/actions/gen_iter_chat_utt.py (95%) rename examples/{st_game => stanford_town}/actions/inner_voice_action.py (94%) rename examples/{st_game => stanford_town}/actions/new_decomp_schedule.py (98%) rename examples/{st_game => stanford_town}/actions/run_reflect_action.py (99%) rename examples/{st_game => stanford_town}/actions/st_action.py (98%) rename examples/{st_game => stanford_town}/actions/summarize_conv.py (96%) rename examples/{st_game => stanford_town}/actions/task_decomp.py (100%) rename examples/{st_game => stanford_town}/actions/wake_up.py (100%) rename examples/{st_game => stanford_town}/memory/__init__.py (100%) rename examples/{st_game => stanford_town}/memory/agent_memory.py (100%) rename examples/{st_game => stanford_town}/memory/retrieve.py (97%) rename examples/{st_game => stanford_town}/memory/scratch.py (100%) rename examples/{st_game => stanford_town}/memory/spatial_memory.py (100%) rename examples/{st_game => stanford_town}/plan/__init__.py (100%) rename examples/{st_game => stanford_town}/plan/converse.py (94%) rename examples/{st_game => stanford_town}/plan/st_plan.py (100%) rename examples/{st_game => stanford_town}/prompts/__init__.py (100%) rename examples/{st_game => stanford_town}/prompts/action_location_object_vMar11.txt (100%) rename examples/{st_game => stanford_town}/prompts/action_location_sector_v1.txt (100%) rename examples/{st_game => stanford_town}/prompts/action_object_v2.txt (100%) rename examples/{st_game => stanford_town}/prompts/daily_planning_v6.txt (100%) rename examples/{st_game => stanford_town}/prompts/decide_to_talk_v2.txt (100%) rename examples/{st_game => stanford_town}/prompts/generate_event_triple_v1.txt (100%) rename examples/{st_game => stanford_town}/prompts/generate_focal_pt_v1.txt (100%) rename examples/{st_game => stanford_town}/prompts/generate_hourly_schedule_v2.txt (100%) rename examples/{st_game => stanford_town}/prompts/generate_obj_event_v1.txt (100%) rename examples/{st_game => stanford_town}/prompts/generate_pronunciatio_v1.txt (100%) rename examples/{st_game => stanford_town}/prompts/insight_and_evidence_v1.txt (100%) rename examples/{st_game => stanford_town}/prompts/iterative_convo_v1.txt (100%) rename examples/{st_game => stanford_town}/prompts/memo_on_convo_v1.txt (100%) rename examples/{st_game => stanford_town}/prompts/new_decomp_schedule_v1.txt (100%) rename examples/{st_game => stanford_town}/prompts/planning_thought_on_convo_v1.txt (100%) rename examples/{st_game => stanford_town}/prompts/poignancy_action_v1.txt (100%) rename examples/{st_game => stanford_town}/prompts/poignancy_chat_v1.txt (100%) rename examples/{st_game => stanford_town}/prompts/poignancy_event_v1.txt (100%) rename examples/{st_game => stanford_town}/prompts/poignancy_thought_v1.txt (100%) rename examples/{st_game => stanford_town}/prompts/summarize_chat_relationship_v2.txt (100%) rename examples/{st_game => stanford_town}/prompts/summarize_conversation_v1.txt (100%) rename examples/{st_game => stanford_town}/prompts/task_decomp_v3.txt (100%) rename examples/{st_game => stanford_town}/prompts/wake_up_hour_v1.txt (100%) rename examples/{st_game => stanford_town}/prompts/whisper_inner_thought_v1.txt (100%) rename examples/{st_game => stanford_town}/reflect/__init__.py (100%) rename examples/{st_game => stanford_town}/reflect/reflect.py (97%) rename examples/{st_game => stanford_town}/requirements.txt (100%) rename examples/{st_game => stanford_town}/roles/__init__.py (100%) rename examples/{st_game => stanford_town}/roles/st_role.py (96%) rename examples/{st_game => stanford_town}/run_st_game.py (89%) rename examples/{st_game => stanford_town}/stanford_town.py (87%) rename examples/{st_game => stanford_town}/static_dirs/assets/the_ville/agent_history_init_n25.csv (100%) rename examples/{st_game => stanford_town}/static_dirs/assets/the_ville/agent_history_init_n3.csv (100%) rename examples/{st_game => stanford_town}/static_dirs/assets/the_ville/matrix/maze/arena_maze.csv (100%) rename examples/{st_game => stanford_town}/static_dirs/assets/the_ville/matrix/maze/collision_maze.csv (100%) rename examples/{st_game => stanford_town}/static_dirs/assets/the_ville/matrix/maze/game_object_maze.csv (100%) rename examples/{st_game => stanford_town}/static_dirs/assets/the_ville/matrix/maze/sector_maze.csv (100%) rename examples/{st_game => stanford_town}/static_dirs/assets/the_ville/matrix/maze/spawning_location_maze.csv (100%) rename examples/{st_game => stanford_town}/static_dirs/assets/the_ville/matrix/maze_meta_info.json (100%) rename examples/{st_game => stanford_town}/static_dirs/assets/the_ville/matrix/special_blocks/arena_blocks.csv (100%) rename examples/{st_game => stanford_town}/static_dirs/assets/the_ville/matrix/special_blocks/game_object_blocks.csv (100%) rename examples/{st_game => stanford_town}/static_dirs/assets/the_ville/matrix/special_blocks/sector_blocks.csv (100%) rename examples/{st_game => stanford_town}/static_dirs/assets/the_ville/matrix/special_blocks/spawning_location_blocks.csv (100%) rename examples/{st_game => stanford_town}/static_dirs/assets/the_ville/matrix/special_blocks/world_blocks.csv (100%) rename examples/{st_game => stanford_town}/storage/.gitignore (100%) rename examples/{st_game => stanford_town}/storage/base_the_ville_isabella_maria_klaus/environment/0.json (100%) rename examples/{st_game => stanford_town}/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/associative_memory/embeddings.json (100%) rename examples/{st_game => stanford_town}/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/associative_memory/kw_strength.json (100%) rename examples/{st_game => stanford_town}/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/associative_memory/nodes.json (100%) rename examples/{st_game => stanford_town}/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/scratch.json (100%) rename examples/{st_game => stanford_town}/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/spatial_memory.json (100%) rename examples/{st_game/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/test_memory => stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/associative_memory}/embeddings.json (100%) rename examples/{st_game => stanford_town}/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/associative_memory/kw_strength.json (100%) rename examples/{st_game/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/test_memory => stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/associative_memory}/nodes.json (100%) rename examples/{st_game => stanford_town}/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/scratch.json (100%) rename examples/{st_game => stanford_town}/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/spatial_memory.json (100%) rename examples/{st_game/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller => stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez}/bootstrap_memory/associative_memory/embeddings.json (100%) rename examples/{st_game => stanford_town}/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/associative_memory/kw_strength.json (100%) rename examples/{st_game/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller => stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez}/bootstrap_memory/associative_memory/nodes.json (100%) rename examples/{st_game => stanford_town}/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/scratch.json (100%) rename examples/{st_game => stanford_town}/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/spatial_memory.json (100%) rename examples/{st_game => stanford_town}/storage/base_the_ville_isabella_maria_klaus/reverie/meta.json (100%) rename examples/{st_game => stanford_town}/tests/__init__.py (100%) rename examples/{st_game => stanford_town}/tests/actions/__init__.py (100%) rename examples/{st_game => stanford_town}/tests/actions/test_gen_action_details.py (90%) rename examples/{st_game => stanford_town}/tests/actions/test_summarize_conv.py (83%) rename examples/{st_game => stanford_town}/tests/plan/__init__.py (100%) rename examples/{st_game => stanford_town}/tests/plan/test_conversation.py (80%) rename examples/{st_game => stanford_town}/tests/plan/test_st_plan.py (87%) rename examples/{st_game => stanford_town}/tests/roles/__init__.py (100%) rename examples/{st_game => stanford_town}/tests/roles/test_st_role.py (67%) rename examples/{st_game => stanford_town}/tests/test_agent_memory.py (94%) rename examples/{st_game => stanford_town}/tests/test_basic_memory.py (96%) rename examples/{st_game => stanford_town}/tests/test_reflect.py (93%) rename examples/{st_game => stanford_town}/tests/test_spatial_memory.py (100%) rename examples/{st_game => stanford_town}/utils/__init__.py (100%) rename examples/{st_game => stanford_town}/utils/const.py (100%) rename examples/{st_game => stanford_town}/utils/mg_ga_transform.py (96%) rename examples/{st_game => stanford_town}/utils/utils.py (100%) rename metagpt/environment/{android_env => android}/__init__.py (100%) rename metagpt/environment/{android_env => android}/android_env.py (83%) rename metagpt/environment/{android_env => android}/android_ext_env.py (99%) rename metagpt/environment/{android_env => android}/const.py (100%) rename metagpt/environment/{minecraft_env => minecraft}/__init__.py (100%) rename metagpt/environment/{minecraft_env => minecraft}/const.py (100%) rename metagpt/environment/{minecraft_env => minecraft}/minecraft_env.py (99%) rename metagpt/environment/{minecraft_env => minecraft}/minecraft_ext_env.py (97%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/.gitignore (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/.prettierignore (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/.prettierrc.json (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/index.js (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/lib/observation/base.js (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/lib/observation/chests.js (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/lib/observation/inventory.js (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/lib/observation/onChat.js (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/lib/observation/onError.js (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/lib/observation/onSave.js (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/lib/observation/status.js (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/lib/observation/voxels.js (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/lib/skillLoader.js (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/lib/utils.js (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/mineflayer-collectblock/.gitignore (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/mineflayer-collectblock/LICENSE (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/mineflayer-collectblock/README.md (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/mineflayer-collectblock/_config.yml (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/mineflayer-collectblock/docs/api.md (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/mineflayer-collectblock/examples/collector.js (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/mineflayer-collectblock/examples/oreMiner.js (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/mineflayer-collectblock/examples/storageBot.js (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/mineflayer-collectblock/package.json (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/mineflayer-collectblock/src/BlockVeins.ts (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/mineflayer-collectblock/src/CollectBlock.ts (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/mineflayer-collectblock/src/Inventory.ts (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/mineflayer-collectblock/src/Targets.ts (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/mineflayer-collectblock/src/TaskQueue.ts (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/mineflayer-collectblock/src/TemporarySubscriber.ts (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/mineflayer-collectblock/src/Util.ts (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/mineflayer-collectblock/src/index.ts (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/mineflayer-collectblock/tsconfig.json (100%) rename metagpt/environment/{minecraft_env => minecraft}/mineflayer/package.json (100%) rename metagpt/environment/{minecraft_env => minecraft}/process_monitor.py (100%) rename metagpt/environment/{software_env => software}/__init__.py (100%) rename metagpt/environment/{software_env => software}/software_env.py (100%) rename metagpt/environment/{stanford_town_env => stanford_town}/__init__.py (100%) rename metagpt/environment/{stanford_town_env => stanford_town}/env_space.py (100%) rename metagpt/environment/{stanford_town_env => stanford_town}/stanford_town_env.py (66%) rename metagpt/environment/{stanford_town_env => stanford_town}/stanford_town_ext_env.py (99%) rename metagpt/environment/{werewolf_env => werewolf}/__init__.py (100%) rename metagpt/environment/{werewolf_env => werewolf}/werewolf_env.py (93%) rename metagpt/environment/{werewolf_env => werewolf}/werewolf_ext_env.py (100%) diff --git a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/test_memory/kw_strength.json b/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/test_memory/kw_strength.json deleted file mode 100644 index 041a8bd0c..000000000 --- a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/test_memory/kw_strength.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "kw_strength_event": {}, - "kw_strength_thought": {} -} \ No newline at end of file diff --git a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/associative_memory/embeddings.json b/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/associative_memory/embeddings.json deleted file mode 100644 index 9e26dfeeb..000000000 --- a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/associative_memory/embeddings.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/associative_memory/nodes.json b/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/associative_memory/nodes.json deleted file mode 100644 index 9e26dfeeb..000000000 --- a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/associative_memory/nodes.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/examples/st_game/.gitignore b/examples/stanford_town/.gitignore similarity index 100% rename from examples/st_game/.gitignore rename to examples/stanford_town/.gitignore diff --git a/examples/st_game/README.md b/examples/stanford_town/README.md similarity index 77% rename from examples/st_game/README.md rename to examples/stanford_town/README.md index 114f7f672..915c61356 100644 --- a/examples/st_game/README.md +++ b/examples/stanford_town/README.md @@ -1,7 +1,7 @@ ## Stanford Town Game ### Pre-Description -The path configured in `examples/st_game/utils/const.py` is the storage path of the current project. In order to facilitate GA( [generative_agents](https://github.com/joonspk-research/generative_agents) )'s frontend docking data (to avoid changing its code), you can set the value `temp_storage_path` to `temp_storage` of `generative_agents` when start `run_st_game.py`. like +The path configured in `examples/stanford_town/utils/const.py` is the storage path of the current project. In order to facilitate GA( [generative_agents](https://github.com/joonspk-research/generative_agents) )'s frontend docking data (to avoid changing its code), you can set the value `temp_storage_path` to `temp_storage` of `generative_agents` when start `run_st_game.py`. like `python3 run_st_game.py --temp_storage_path path/to/ga/temp_storage xxx` @@ -17,7 +17,7 @@ # updated This can be used to achieve docking of simulation data without changing the GA code. Otherwise, the GA code must be modified to adapt to the MG output path. -If you don't want to start from 0, copy other simulation directories under `generative_agents/environment/frontend_server/storage/` to `examples/st_game/storage`, and select a directory named `fork_sim_code`. +If you don't want to start from 0, copy other simulation directories under `generative_agents/environment/frontend_server/storage/` to `examples/stanford_town/storage`, and select a directory named `fork_sim_code`. ### Backend service startup The execution entry is `python3 run_st_game.py "Host a open lunch party at 13:00 pm" "base_the_ville_isabella_maria_klaus" "test_sim" 10` diff --git a/examples/st_game/README_CN.md b/examples/stanford_town/README_CN.md similarity index 77% rename from examples/st_game/README_CN.md rename to examples/stanford_town/README_CN.md index 84470f5c2..445a5b1b3 100644 --- a/examples/st_game/README_CN.md +++ b/examples/stanford_town/README_CN.md @@ -1,7 +1,7 @@ ## Stanford Town Game ### 前置 -`examples/st_game/utils/const.py`配置的路径为当前项目的存储路径,为了方便GA( [generative_agents](https://github.com/joonspk-research/generative_agents) )的前端对接数据(避免改动它那块的代码),可在启动`run_st_game.py`加上`temp_storage_path`指向`generative_agents`对应的`temp_storage`路径。比如 +`examples/stanford_town/utils/const.py`配置的路径为当前项目的存储路径,为了方便GA( [generative_agents](https://github.com/joonspk-research/generative_agents) )的前端对接数据(避免改动它那块的代码),可在启动`run_st_game.py`加上`temp_storage_path`指向`generative_agents`对应的`temp_storage`路径。比如 `python3 run_st_game.py --temp_storage_path path/to/ga/temp_storage xxx` @@ -16,7 +16,7 @@ # 更新为 ``` 这样可用实现不改变GA代码情况下,实现仿真数据的对接。不然得修改GA的代码来适配MG的输出路径。 -如果你不想从0开始启动,拷贝`generative_agents/environment/frontend_server/storage/`下的其他仿真目录到`examples/st_game/storage`,并选择一个目录名作为`fork_sim_code`。 +如果你不想从0开始启动,拷贝`generative_agents/environment/frontend_server/storage/`下的其他仿真目录到`examples/stanford_town/storage`,并选择一个目录名作为`fork_sim_code`。 ### 后端服务启动 执行入口为:`python3 run_st_game.py "Host a open lunch party at 13:00 pm" "base_the_ville_isabella_maria_klaus" "test_sim" 10` diff --git a/examples/st_game/__init__.py b/examples/stanford_town/__init__.py similarity index 100% rename from examples/st_game/__init__.py rename to examples/stanford_town/__init__.py diff --git a/examples/st_game/actions/__init__.py b/examples/stanford_town/actions/__init__.py similarity index 100% rename from examples/st_game/actions/__init__.py rename to examples/stanford_town/actions/__init__.py diff --git a/examples/st_game/actions/agent_chat_sum_rel.py b/examples/stanford_town/actions/agent_chat_sum_rel.py similarity index 95% rename from examples/st_game/actions/agent_chat_sum_rel.py rename to examples/stanford_town/actions/agent_chat_sum_rel.py index 00f15e82f..3e564a60c 100644 --- a/examples/st_game/actions/agent_chat_sum_rel.py +++ b/examples/stanford_town/actions/agent_chat_sum_rel.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # @Desc : summarize relationship in a agent chat -from examples.st_game.actions.st_action import STAction +from examples.stanford_town.actions.st_action import STAction from metagpt.logs import logger diff --git a/examples/st_game/actions/decide_to_talk.py b/examples/stanford_town/actions/decide_to_talk.py similarity index 98% rename from examples/st_game/actions/decide_to_talk.py rename to examples/stanford_town/actions/decide_to_talk.py index cabb5ceff..414ee7e36 100644 --- a/examples/st_game/actions/decide_to_talk.py +++ b/examples/stanford_town/actions/decide_to_talk.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # @Desc : device to talk to another role, return yes or no -from examples.st_game.actions.st_action import STAction +from examples.stanford_town.actions.st_action import STAction from metagpt.logs import logger diff --git a/examples/st_game/actions/dummy_action.py b/examples/stanford_town/actions/dummy_action.py similarity index 100% rename from examples/st_game/actions/dummy_action.py rename to examples/stanford_town/actions/dummy_action.py diff --git a/examples/st_game/actions/gen_action_details.py b/examples/stanford_town/actions/gen_action_details.py similarity index 99% rename from examples/st_game/actions/gen_action_details.py rename to examples/stanford_town/actions/gen_action_details.py index 6af2cb338..0eb7cb701 100644 --- a/examples/st_game/actions/gen_action_details.py +++ b/examples/stanford_town/actions/gen_action_details.py @@ -4,7 +4,7 @@ import random -from metagpt.environment.stanford_town_env.env_space import EnvObsParams, EnvObsType +from metagpt.environment.stanford_town.env_space import EnvObsParams, EnvObsType from metagpt.logs import logger from .st_action import STAction diff --git a/examples/st_game/actions/gen_daily_schedule.py b/examples/stanford_town/actions/gen_daily_schedule.py similarity index 100% rename from examples/st_game/actions/gen_daily_schedule.py rename to examples/stanford_town/actions/gen_daily_schedule.py diff --git a/examples/st_game/actions/gen_hourly_schedule.py b/examples/stanford_town/actions/gen_hourly_schedule.py similarity index 100% rename from examples/st_game/actions/gen_hourly_schedule.py rename to examples/stanford_town/actions/gen_hourly_schedule.py diff --git a/examples/st_game/actions/gen_iter_chat_utt.py b/examples/stanford_town/actions/gen_iter_chat_utt.py similarity index 95% rename from examples/st_game/actions/gen_iter_chat_utt.py rename to examples/stanford_town/actions/gen_iter_chat_utt.py index eb5f569c7..82104b6ca 100644 --- a/examples/st_game/actions/gen_iter_chat_utt.py +++ b/examples/stanford_town/actions/gen_iter_chat_utt.py @@ -2,9 +2,9 @@ # -*- coding: utf-8 -*- # @Desc : generate_iterative_chat_utt -from examples.st_game.actions.st_action import STAction -from examples.st_game.utils.utils import extract_first_json_dict -from metagpt.environment.stanford_town_env.env_space import EnvObsParams, EnvObsType +from examples.stanford_town.actions.st_action import STAction +from examples.stanford_town.utils.utils import extract_first_json_dict +from metagpt.environment.stanford_town.env_space import EnvObsParams, EnvObsType from metagpt.logs import logger diff --git a/examples/st_game/actions/inner_voice_action.py b/examples/stanford_town/actions/inner_voice_action.py similarity index 94% rename from examples/st_game/actions/inner_voice_action.py rename to examples/stanford_town/actions/inner_voice_action.py index cfbdf0303..121f1dcee 100644 --- a/examples/st_game/actions/inner_voice_action.py +++ b/examples/stanford_town/actions/inner_voice_action.py @@ -1,4 +1,4 @@ -from examples.st_game.actions.st_action import STAction +from examples.stanford_town.actions.st_action import STAction from metagpt.logs import logger diff --git a/examples/st_game/actions/new_decomp_schedule.py b/examples/stanford_town/actions/new_decomp_schedule.py similarity index 98% rename from examples/st_game/actions/new_decomp_schedule.py rename to examples/stanford_town/actions/new_decomp_schedule.py index 8e5c79401..c7078be9c 100644 --- a/examples/st_game/actions/new_decomp_schedule.py +++ b/examples/stanford_town/actions/new_decomp_schedule.py @@ -4,7 +4,7 @@ import datetime -from examples.st_game.actions.st_action import STAction +from examples.stanford_town.actions.st_action import STAction from metagpt.logs import logger diff --git a/examples/st_game/actions/run_reflect_action.py b/examples/stanford_town/actions/run_reflect_action.py similarity index 99% rename from examples/st_game/actions/run_reflect_action.py rename to examples/stanford_town/actions/run_reflect_action.py index d3bf008cb..055c03db4 100644 --- a/examples/st_game/actions/run_reflect_action.py +++ b/examples/stanford_town/actions/run_reflect_action.py @@ -4,7 +4,7 @@ import re -from examples.st_game.actions.st_action import STAction +from examples.stanford_town.actions.st_action import STAction from metagpt.logs import logger diff --git a/examples/st_game/actions/st_action.py b/examples/stanford_town/actions/st_action.py similarity index 98% rename from examples/st_game/actions/st_action.py rename to examples/stanford_town/actions/st_action.py index 81f66c080..72ef851e0 100644 --- a/examples/st_game/actions/st_action.py +++ b/examples/stanford_town/actions/st_action.py @@ -7,7 +7,7 @@ from abc import abstractmethod from pathlib import Path from typing import Any, Optional, Union -from examples.st_game.utils.const import PROMPTS_DIR +from examples.stanford_town.utils.const import PROMPTS_DIR from metagpt.actions.action import Action from metagpt.config2 import config from metagpt.logs import logger diff --git a/examples/st_game/actions/summarize_conv.py b/examples/stanford_town/actions/summarize_conv.py similarity index 96% rename from examples/st_game/actions/summarize_conv.py rename to examples/stanford_town/actions/summarize_conv.py index f35651b35..f01fb36ad 100644 --- a/examples/st_game/actions/summarize_conv.py +++ b/examples/stanford_town/actions/summarize_conv.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # @Desc : summarize the content of agents' conversation -from examples.st_game.actions.st_action import STAction +from examples.stanford_town.actions.st_action import STAction from metagpt.logs import logger diff --git a/examples/st_game/actions/task_decomp.py b/examples/stanford_town/actions/task_decomp.py similarity index 100% rename from examples/st_game/actions/task_decomp.py rename to examples/stanford_town/actions/task_decomp.py diff --git a/examples/st_game/actions/wake_up.py b/examples/stanford_town/actions/wake_up.py similarity index 100% rename from examples/st_game/actions/wake_up.py rename to examples/stanford_town/actions/wake_up.py diff --git a/examples/st_game/memory/__init__.py b/examples/stanford_town/memory/__init__.py similarity index 100% rename from examples/st_game/memory/__init__.py rename to examples/stanford_town/memory/__init__.py diff --git a/examples/st_game/memory/agent_memory.py b/examples/stanford_town/memory/agent_memory.py similarity index 100% rename from examples/st_game/memory/agent_memory.py rename to examples/stanford_town/memory/agent_memory.py diff --git a/examples/st_game/memory/retrieve.py b/examples/stanford_town/memory/retrieve.py similarity index 97% rename from examples/st_game/memory/retrieve.py rename to examples/stanford_town/memory/retrieve.py index eeeecf85a..db3a87bea 100644 --- a/examples/st_game/memory/retrieve.py +++ b/examples/stanford_town/memory/retrieve.py @@ -7,8 +7,8 @@ import datetime from numpy import dot from numpy.linalg import norm -from examples.st_game.memory.agent_memory import BasicMemory -from examples.st_game.utils.utils import get_embedding +from examples.stanford_town.memory.agent_memory import BasicMemory +from examples.stanford_town.utils.utils import get_embedding def agent_retrieve( diff --git a/examples/st_game/memory/scratch.py b/examples/stanford_town/memory/scratch.py similarity index 100% rename from examples/st_game/memory/scratch.py rename to examples/stanford_town/memory/scratch.py diff --git a/examples/st_game/memory/spatial_memory.py b/examples/stanford_town/memory/spatial_memory.py similarity index 100% rename from examples/st_game/memory/spatial_memory.py rename to examples/stanford_town/memory/spatial_memory.py diff --git a/examples/st_game/plan/__init__.py b/examples/stanford_town/plan/__init__.py similarity index 100% rename from examples/st_game/plan/__init__.py rename to examples/stanford_town/plan/__init__.py diff --git a/examples/st_game/plan/converse.py b/examples/stanford_town/plan/converse.py similarity index 94% rename from examples/st_game/plan/converse.py rename to examples/stanford_town/plan/converse.py index 0371b3d44..b0ff54b68 100644 --- a/examples/st_game/plan/converse.py +++ b/examples/stanford_town/plan/converse.py @@ -4,9 +4,9 @@ from typing import Tuple -from examples.st_game.actions.agent_chat_sum_rel import AgentChatSumRel -from examples.st_game.actions.gen_iter_chat_utt import GenIterChatUTT -from examples.st_game.memory.retrieve import new_agent_retrieve +from examples.stanford_town.actions.agent_chat_sum_rel import AgentChatSumRel +from examples.stanford_town.actions.gen_iter_chat_utt import GenIterChatUTT +from examples.stanford_town.memory.retrieve import new_agent_retrieve from metagpt.logs import logger diff --git a/examples/st_game/plan/st_plan.py b/examples/stanford_town/plan/st_plan.py similarity index 100% rename from examples/st_game/plan/st_plan.py rename to examples/stanford_town/plan/st_plan.py diff --git a/examples/st_game/prompts/__init__.py b/examples/stanford_town/prompts/__init__.py similarity index 100% rename from examples/st_game/prompts/__init__.py rename to examples/stanford_town/prompts/__init__.py diff --git a/examples/st_game/prompts/action_location_object_vMar11.txt b/examples/stanford_town/prompts/action_location_object_vMar11.txt similarity index 100% rename from examples/st_game/prompts/action_location_object_vMar11.txt rename to examples/stanford_town/prompts/action_location_object_vMar11.txt diff --git a/examples/st_game/prompts/action_location_sector_v1.txt b/examples/stanford_town/prompts/action_location_sector_v1.txt similarity index 100% rename from examples/st_game/prompts/action_location_sector_v1.txt rename to examples/stanford_town/prompts/action_location_sector_v1.txt diff --git a/examples/st_game/prompts/action_object_v2.txt b/examples/stanford_town/prompts/action_object_v2.txt similarity index 100% rename from examples/st_game/prompts/action_object_v2.txt rename to examples/stanford_town/prompts/action_object_v2.txt diff --git a/examples/st_game/prompts/daily_planning_v6.txt b/examples/stanford_town/prompts/daily_planning_v6.txt similarity index 100% rename from examples/st_game/prompts/daily_planning_v6.txt rename to examples/stanford_town/prompts/daily_planning_v6.txt diff --git a/examples/st_game/prompts/decide_to_talk_v2.txt b/examples/stanford_town/prompts/decide_to_talk_v2.txt similarity index 100% rename from examples/st_game/prompts/decide_to_talk_v2.txt rename to examples/stanford_town/prompts/decide_to_talk_v2.txt diff --git a/examples/st_game/prompts/generate_event_triple_v1.txt b/examples/stanford_town/prompts/generate_event_triple_v1.txt similarity index 100% rename from examples/st_game/prompts/generate_event_triple_v1.txt rename to examples/stanford_town/prompts/generate_event_triple_v1.txt diff --git a/examples/st_game/prompts/generate_focal_pt_v1.txt b/examples/stanford_town/prompts/generate_focal_pt_v1.txt similarity index 100% rename from examples/st_game/prompts/generate_focal_pt_v1.txt rename to examples/stanford_town/prompts/generate_focal_pt_v1.txt diff --git a/examples/st_game/prompts/generate_hourly_schedule_v2.txt b/examples/stanford_town/prompts/generate_hourly_schedule_v2.txt similarity index 100% rename from examples/st_game/prompts/generate_hourly_schedule_v2.txt rename to examples/stanford_town/prompts/generate_hourly_schedule_v2.txt diff --git a/examples/st_game/prompts/generate_obj_event_v1.txt b/examples/stanford_town/prompts/generate_obj_event_v1.txt similarity index 100% rename from examples/st_game/prompts/generate_obj_event_v1.txt rename to examples/stanford_town/prompts/generate_obj_event_v1.txt diff --git a/examples/st_game/prompts/generate_pronunciatio_v1.txt b/examples/stanford_town/prompts/generate_pronunciatio_v1.txt similarity index 100% rename from examples/st_game/prompts/generate_pronunciatio_v1.txt rename to examples/stanford_town/prompts/generate_pronunciatio_v1.txt diff --git a/examples/st_game/prompts/insight_and_evidence_v1.txt b/examples/stanford_town/prompts/insight_and_evidence_v1.txt similarity index 100% rename from examples/st_game/prompts/insight_and_evidence_v1.txt rename to examples/stanford_town/prompts/insight_and_evidence_v1.txt diff --git a/examples/st_game/prompts/iterative_convo_v1.txt b/examples/stanford_town/prompts/iterative_convo_v1.txt similarity index 100% rename from examples/st_game/prompts/iterative_convo_v1.txt rename to examples/stanford_town/prompts/iterative_convo_v1.txt diff --git a/examples/st_game/prompts/memo_on_convo_v1.txt b/examples/stanford_town/prompts/memo_on_convo_v1.txt similarity index 100% rename from examples/st_game/prompts/memo_on_convo_v1.txt rename to examples/stanford_town/prompts/memo_on_convo_v1.txt diff --git a/examples/st_game/prompts/new_decomp_schedule_v1.txt b/examples/stanford_town/prompts/new_decomp_schedule_v1.txt similarity index 100% rename from examples/st_game/prompts/new_decomp_schedule_v1.txt rename to examples/stanford_town/prompts/new_decomp_schedule_v1.txt diff --git a/examples/st_game/prompts/planning_thought_on_convo_v1.txt b/examples/stanford_town/prompts/planning_thought_on_convo_v1.txt similarity index 100% rename from examples/st_game/prompts/planning_thought_on_convo_v1.txt rename to examples/stanford_town/prompts/planning_thought_on_convo_v1.txt diff --git a/examples/st_game/prompts/poignancy_action_v1.txt b/examples/stanford_town/prompts/poignancy_action_v1.txt similarity index 100% rename from examples/st_game/prompts/poignancy_action_v1.txt rename to examples/stanford_town/prompts/poignancy_action_v1.txt diff --git a/examples/st_game/prompts/poignancy_chat_v1.txt b/examples/stanford_town/prompts/poignancy_chat_v1.txt similarity index 100% rename from examples/st_game/prompts/poignancy_chat_v1.txt rename to examples/stanford_town/prompts/poignancy_chat_v1.txt diff --git a/examples/st_game/prompts/poignancy_event_v1.txt b/examples/stanford_town/prompts/poignancy_event_v1.txt similarity index 100% rename from examples/st_game/prompts/poignancy_event_v1.txt rename to examples/stanford_town/prompts/poignancy_event_v1.txt diff --git a/examples/st_game/prompts/poignancy_thought_v1.txt b/examples/stanford_town/prompts/poignancy_thought_v1.txt similarity index 100% rename from examples/st_game/prompts/poignancy_thought_v1.txt rename to examples/stanford_town/prompts/poignancy_thought_v1.txt diff --git a/examples/st_game/prompts/summarize_chat_relationship_v2.txt b/examples/stanford_town/prompts/summarize_chat_relationship_v2.txt similarity index 100% rename from examples/st_game/prompts/summarize_chat_relationship_v2.txt rename to examples/stanford_town/prompts/summarize_chat_relationship_v2.txt diff --git a/examples/st_game/prompts/summarize_conversation_v1.txt b/examples/stanford_town/prompts/summarize_conversation_v1.txt similarity index 100% rename from examples/st_game/prompts/summarize_conversation_v1.txt rename to examples/stanford_town/prompts/summarize_conversation_v1.txt diff --git a/examples/st_game/prompts/task_decomp_v3.txt b/examples/stanford_town/prompts/task_decomp_v3.txt similarity index 100% rename from examples/st_game/prompts/task_decomp_v3.txt rename to examples/stanford_town/prompts/task_decomp_v3.txt diff --git a/examples/st_game/prompts/wake_up_hour_v1.txt b/examples/stanford_town/prompts/wake_up_hour_v1.txt similarity index 100% rename from examples/st_game/prompts/wake_up_hour_v1.txt rename to examples/stanford_town/prompts/wake_up_hour_v1.txt diff --git a/examples/st_game/prompts/whisper_inner_thought_v1.txt b/examples/stanford_town/prompts/whisper_inner_thought_v1.txt similarity index 100% rename from examples/st_game/prompts/whisper_inner_thought_v1.txt rename to examples/stanford_town/prompts/whisper_inner_thought_v1.txt diff --git a/examples/st_game/reflect/__init__.py b/examples/stanford_town/reflect/__init__.py similarity index 100% rename from examples/st_game/reflect/__init__.py rename to examples/stanford_town/reflect/__init__.py diff --git a/examples/st_game/reflect/reflect.py b/examples/stanford_town/reflect/reflect.py similarity index 97% rename from examples/st_game/reflect/reflect.py rename to examples/stanford_town/reflect/reflect.py index 0c855b8f1..beec53dc2 100644 --- a/examples/st_game/reflect/reflect.py +++ b/examples/stanford_town/reflect/reflect.py @@ -5,7 +5,7 @@ import datetime import time -from examples.st_game.actions.run_reflect_action import ( +from examples.stanford_town.actions.run_reflect_action import ( AgentChatPoignancy, AgentEventPoignancy, AgentEventTriple, @@ -14,8 +14,8 @@ from examples.st_game.actions.run_reflect_action import ( AgentMemoryOnConvo, AgentPlanThoughtOnConvo, ) -from examples.st_game.memory.retrieve import new_agent_retrieve -from examples.st_game.utils.utils import get_embedding +from examples.stanford_town.memory.retrieve import new_agent_retrieve +from examples.stanford_town.utils.utils import get_embedding from metagpt.logs import logger diff --git a/examples/st_game/requirements.txt b/examples/stanford_town/requirements.txt similarity index 100% rename from examples/st_game/requirements.txt rename to examples/stanford_town/requirements.txt diff --git a/examples/st_game/roles/__init__.py b/examples/stanford_town/roles/__init__.py similarity index 100% rename from examples/st_game/roles/__init__.py rename to examples/stanford_town/roles/__init__.py diff --git a/examples/st_game/roles/st_role.py b/examples/stanford_town/roles/st_role.py similarity index 96% rename from examples/st_game/roles/st_role.py rename to examples/stanford_town/roles/st_role.py index 48de34f15..414fd40b8 100644 --- a/examples/st_game/roles/st_role.py +++ b/examples/stanford_town/roles/st_role.py @@ -20,23 +20,23 @@ from typing import TYPE_CHECKING, Optional from pydantic import ConfigDict, Field, field_validator, model_validator -from examples.st_game.actions.dummy_action import DummyAction, DummyMessage -from examples.st_game.actions.inner_voice_action import AgentWhisperThoughtAction -from examples.st_game.actions.run_reflect_action import AgentEventTriple -from examples.st_game.memory.agent_memory import AgentMemory, BasicMemory -from examples.st_game.memory.scratch import Scratch -from examples.st_game.memory.spatial_memory import MemoryTree -from examples.st_game.plan.st_plan import plan -from examples.st_game.reflect.reflect import generate_poig_score, role_reflect -from examples.st_game.utils.const import STORAGE_PATH, collision_block_id -from examples.st_game.utils.mg_ga_transform import ( +from examples.stanford_town.actions.dummy_action import DummyAction, DummyMessage +from examples.stanford_town.actions.inner_voice_action import AgentWhisperThoughtAction +from examples.stanford_town.actions.run_reflect_action import AgentEventTriple +from examples.stanford_town.memory.agent_memory import AgentMemory, BasicMemory +from examples.stanford_town.memory.scratch import Scratch +from examples.stanford_town.memory.spatial_memory import MemoryTree +from examples.stanford_town.plan.st_plan import plan +from examples.stanford_town.reflect.reflect import generate_poig_score, role_reflect +from examples.stanford_town.utils.const import STORAGE_PATH, collision_block_id +from examples.stanford_town.utils.mg_ga_transform import ( get_role_environment, save_environment, save_movement, ) -from examples.st_game.utils.utils import get_embedding, path_finder +from examples.stanford_town.utils.utils import get_embedding, path_finder from metagpt.actions.add_requirement import UserRequirement -from metagpt.environment.stanford_town_env.env_space import ( +from metagpt.environment.stanford_town.env_space import ( EnvAction, EnvActionType, EnvObsParams, @@ -48,7 +48,7 @@ from metagpt.schema import Message from metagpt.utils.common import any_to_str if TYPE_CHECKING: - from metagpt.environment.stanford_town_env.stanford_town_env import ( # noqa: F401 + from metagpt.environment.stanford_town.stanford_town_env import ( # noqa: F401 StanfordTownEnv, ) @@ -63,7 +63,7 @@ class STRoleContext(RoleContext): @classmethod def model_rebuild(cls, **kwargs): - from metagpt.environment.stanford_town_env.stanford_town_env import ( # noqa: F401 + from metagpt.environment.stanford_town.stanford_town_env import ( # noqa: F401 StanfordTownEnv, ) diff --git a/examples/st_game/run_st_game.py b/examples/stanford_town/run_st_game.py similarity index 89% rename from examples/st_game/run_st_game.py rename to examples/stanford_town/run_st_game.py index 304bf24ba..4c3b3bb0e 100644 --- a/examples/st_game/run_st_game.py +++ b/examples/stanford_town/run_st_game.py @@ -7,15 +7,15 @@ from typing import Optional import fire -from examples.st_game.roles.st_role import STRole -from examples.st_game.stanford_town import StanfordTown -from examples.st_game.utils.const import STORAGE_PATH -from examples.st_game.utils.mg_ga_transform import ( +from examples.stanford_town.roles.st_role import STRole +from examples.stanford_town.stanford_town import StanfordTown +from examples.stanford_town.utils.const import STORAGE_PATH +from examples.stanford_town.utils.mg_ga_transform import ( get_reverie_meta, write_curr_sim_code, write_curr_step, ) -from examples.st_game.utils.utils import copy_folder +from examples.stanford_town.utils.utils import copy_folder from metagpt.logs import logger diff --git a/examples/st_game/stanford_town.py b/examples/stanford_town/stanford_town.py similarity index 87% rename from examples/st_game/stanford_town.py rename to examples/stanford_town/stanford_town.py index f10332b60..7c39cbf04 100644 --- a/examples/st_game/stanford_town.py +++ b/examples/stanford_town/stanford_town.py @@ -4,10 +4,10 @@ from typing import Any, Optional -from examples.st_game.roles.st_role import STRole -from examples.st_game.utils.const import MAZE_ASSET_PATH +from examples.stanford_town.roles.st_role import STRole +from examples.stanford_town.utils.const import MAZE_ASSET_PATH from metagpt.context import Context -from metagpt.environment.stanford_town_env.stanford_town_env import StanfordTownEnv +from metagpt.environment.stanford_town.stanford_town_env import StanfordTownEnv from metagpt.logs import logger from metagpt.team import Team diff --git a/examples/st_game/static_dirs/assets/the_ville/agent_history_init_n25.csv b/examples/stanford_town/static_dirs/assets/the_ville/agent_history_init_n25.csv similarity index 100% rename from examples/st_game/static_dirs/assets/the_ville/agent_history_init_n25.csv rename to examples/stanford_town/static_dirs/assets/the_ville/agent_history_init_n25.csv diff --git a/examples/st_game/static_dirs/assets/the_ville/agent_history_init_n3.csv b/examples/stanford_town/static_dirs/assets/the_ville/agent_history_init_n3.csv similarity index 100% rename from examples/st_game/static_dirs/assets/the_ville/agent_history_init_n3.csv rename to examples/stanford_town/static_dirs/assets/the_ville/agent_history_init_n3.csv diff --git a/examples/st_game/static_dirs/assets/the_ville/matrix/maze/arena_maze.csv b/examples/stanford_town/static_dirs/assets/the_ville/matrix/maze/arena_maze.csv similarity index 100% rename from examples/st_game/static_dirs/assets/the_ville/matrix/maze/arena_maze.csv rename to examples/stanford_town/static_dirs/assets/the_ville/matrix/maze/arena_maze.csv diff --git a/examples/st_game/static_dirs/assets/the_ville/matrix/maze/collision_maze.csv b/examples/stanford_town/static_dirs/assets/the_ville/matrix/maze/collision_maze.csv similarity index 100% rename from examples/st_game/static_dirs/assets/the_ville/matrix/maze/collision_maze.csv rename to examples/stanford_town/static_dirs/assets/the_ville/matrix/maze/collision_maze.csv diff --git a/examples/st_game/static_dirs/assets/the_ville/matrix/maze/game_object_maze.csv b/examples/stanford_town/static_dirs/assets/the_ville/matrix/maze/game_object_maze.csv similarity index 100% rename from examples/st_game/static_dirs/assets/the_ville/matrix/maze/game_object_maze.csv rename to examples/stanford_town/static_dirs/assets/the_ville/matrix/maze/game_object_maze.csv diff --git a/examples/st_game/static_dirs/assets/the_ville/matrix/maze/sector_maze.csv b/examples/stanford_town/static_dirs/assets/the_ville/matrix/maze/sector_maze.csv similarity index 100% rename from examples/st_game/static_dirs/assets/the_ville/matrix/maze/sector_maze.csv rename to examples/stanford_town/static_dirs/assets/the_ville/matrix/maze/sector_maze.csv diff --git a/examples/st_game/static_dirs/assets/the_ville/matrix/maze/spawning_location_maze.csv b/examples/stanford_town/static_dirs/assets/the_ville/matrix/maze/spawning_location_maze.csv similarity index 100% rename from examples/st_game/static_dirs/assets/the_ville/matrix/maze/spawning_location_maze.csv rename to examples/stanford_town/static_dirs/assets/the_ville/matrix/maze/spawning_location_maze.csv diff --git a/examples/st_game/static_dirs/assets/the_ville/matrix/maze_meta_info.json b/examples/stanford_town/static_dirs/assets/the_ville/matrix/maze_meta_info.json similarity index 100% rename from examples/st_game/static_dirs/assets/the_ville/matrix/maze_meta_info.json rename to examples/stanford_town/static_dirs/assets/the_ville/matrix/maze_meta_info.json diff --git a/examples/st_game/static_dirs/assets/the_ville/matrix/special_blocks/arena_blocks.csv b/examples/stanford_town/static_dirs/assets/the_ville/matrix/special_blocks/arena_blocks.csv similarity index 100% rename from examples/st_game/static_dirs/assets/the_ville/matrix/special_blocks/arena_blocks.csv rename to examples/stanford_town/static_dirs/assets/the_ville/matrix/special_blocks/arena_blocks.csv diff --git a/examples/st_game/static_dirs/assets/the_ville/matrix/special_blocks/game_object_blocks.csv b/examples/stanford_town/static_dirs/assets/the_ville/matrix/special_blocks/game_object_blocks.csv similarity index 100% rename from examples/st_game/static_dirs/assets/the_ville/matrix/special_blocks/game_object_blocks.csv rename to examples/stanford_town/static_dirs/assets/the_ville/matrix/special_blocks/game_object_blocks.csv diff --git a/examples/st_game/static_dirs/assets/the_ville/matrix/special_blocks/sector_blocks.csv b/examples/stanford_town/static_dirs/assets/the_ville/matrix/special_blocks/sector_blocks.csv similarity index 100% rename from examples/st_game/static_dirs/assets/the_ville/matrix/special_blocks/sector_blocks.csv rename to examples/stanford_town/static_dirs/assets/the_ville/matrix/special_blocks/sector_blocks.csv diff --git a/examples/st_game/static_dirs/assets/the_ville/matrix/special_blocks/spawning_location_blocks.csv b/examples/stanford_town/static_dirs/assets/the_ville/matrix/special_blocks/spawning_location_blocks.csv similarity index 100% rename from examples/st_game/static_dirs/assets/the_ville/matrix/special_blocks/spawning_location_blocks.csv rename to examples/stanford_town/static_dirs/assets/the_ville/matrix/special_blocks/spawning_location_blocks.csv diff --git a/examples/st_game/static_dirs/assets/the_ville/matrix/special_blocks/world_blocks.csv b/examples/stanford_town/static_dirs/assets/the_ville/matrix/special_blocks/world_blocks.csv similarity index 100% rename from examples/st_game/static_dirs/assets/the_ville/matrix/special_blocks/world_blocks.csv rename to examples/stanford_town/static_dirs/assets/the_ville/matrix/special_blocks/world_blocks.csv diff --git a/examples/st_game/storage/.gitignore b/examples/stanford_town/storage/.gitignore similarity index 100% rename from examples/st_game/storage/.gitignore rename to examples/stanford_town/storage/.gitignore diff --git a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/environment/0.json b/examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/environment/0.json similarity index 100% rename from examples/st_game/storage/base_the_ville_isabella_maria_klaus/environment/0.json rename to examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/environment/0.json diff --git a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/associative_memory/embeddings.json b/examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/associative_memory/embeddings.json similarity index 100% rename from examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/associative_memory/embeddings.json rename to examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/associative_memory/embeddings.json diff --git a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/associative_memory/kw_strength.json b/examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/associative_memory/kw_strength.json similarity index 100% rename from examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/associative_memory/kw_strength.json rename to examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/associative_memory/kw_strength.json diff --git a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/associative_memory/nodes.json b/examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/associative_memory/nodes.json similarity index 100% rename from examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/associative_memory/nodes.json rename to examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/associative_memory/nodes.json diff --git a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/scratch.json b/examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/scratch.json similarity index 100% rename from examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/scratch.json rename to examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/scratch.json diff --git a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/spatial_memory.json b/examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/spatial_memory.json similarity index 100% rename from examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/spatial_memory.json rename to examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/spatial_memory.json diff --git a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/test_memory/embeddings.json b/examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/associative_memory/embeddings.json similarity index 100% rename from examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/test_memory/embeddings.json rename to examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/associative_memory/embeddings.json diff --git a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/associative_memory/kw_strength.json b/examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/associative_memory/kw_strength.json similarity index 100% rename from examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/associative_memory/kw_strength.json rename to examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/associative_memory/kw_strength.json diff --git a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/test_memory/nodes.json b/examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/associative_memory/nodes.json similarity index 100% rename from examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Isabella Rodriguez/bootstrap_memory/test_memory/nodes.json rename to examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/associative_memory/nodes.json diff --git a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/scratch.json b/examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/scratch.json similarity index 100% rename from examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/scratch.json rename to examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/scratch.json diff --git a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/spatial_memory.json b/examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/spatial_memory.json similarity index 100% rename from examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/spatial_memory.json rename to examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/spatial_memory.json diff --git a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/associative_memory/embeddings.json b/examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/associative_memory/embeddings.json similarity index 100% rename from examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/associative_memory/embeddings.json rename to examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/associative_memory/embeddings.json diff --git a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/associative_memory/kw_strength.json b/examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/associative_memory/kw_strength.json similarity index 100% rename from examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/associative_memory/kw_strength.json rename to examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/associative_memory/kw_strength.json diff --git a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/associative_memory/nodes.json b/examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/associative_memory/nodes.json similarity index 100% rename from examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Klaus Mueller/bootstrap_memory/associative_memory/nodes.json rename to examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/associative_memory/nodes.json diff --git a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/scratch.json b/examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/scratch.json similarity index 100% rename from examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/scratch.json rename to examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/scratch.json diff --git a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/spatial_memory.json b/examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/spatial_memory.json similarity index 100% rename from examples/st_game/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/spatial_memory.json rename to examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/personas/Maria Lopez/bootstrap_memory/spatial_memory.json diff --git a/examples/st_game/storage/base_the_ville_isabella_maria_klaus/reverie/meta.json b/examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/reverie/meta.json similarity index 100% rename from examples/st_game/storage/base_the_ville_isabella_maria_klaus/reverie/meta.json rename to examples/stanford_town/storage/base_the_ville_isabella_maria_klaus/reverie/meta.json diff --git a/examples/st_game/tests/__init__.py b/examples/stanford_town/tests/__init__.py similarity index 100% rename from examples/st_game/tests/__init__.py rename to examples/stanford_town/tests/__init__.py diff --git a/examples/st_game/tests/actions/__init__.py b/examples/stanford_town/tests/actions/__init__.py similarity index 100% rename from examples/st_game/tests/actions/__init__.py rename to examples/stanford_town/tests/actions/__init__.py diff --git a/examples/st_game/tests/actions/test_gen_action_details.py b/examples/stanford_town/tests/actions/test_gen_action_details.py similarity index 90% rename from examples/st_game/tests/actions/test_gen_action_details.py rename to examples/stanford_town/tests/actions/test_gen_action_details.py index 49e24481d..bf6b75c04 100644 --- a/examples/st_game/tests/actions/test_gen_action_details.py +++ b/examples/stanford_town/tests/actions/test_gen_action_details.py @@ -4,17 +4,17 @@ import pytest -from examples.st_game.actions.gen_action_details import ( +from examples.stanford_town.actions.gen_action_details import ( GenActionArena, GenActionDetails, GenActionObject, GenActionSector, GenActObjDescription, ) -from examples.st_game.roles.st_role import STRole -from examples.st_game.utils.const import MAZE_ASSET_PATH +from examples.stanford_town.roles.st_role import STRole +from examples.stanford_town.utils.const import MAZE_ASSET_PATH from metagpt.environment.api.env_api import EnvAPIAbstract -from metagpt.environment.stanford_town_env.stanford_town_env import StanfordTownEnv +from metagpt.environment.stanford_town.stanford_town_env import StanfordTownEnv @pytest.mark.asyncio diff --git a/examples/st_game/tests/actions/test_summarize_conv.py b/examples/stanford_town/tests/actions/test_summarize_conv.py similarity index 83% rename from examples/st_game/tests/actions/test_summarize_conv.py rename to examples/stanford_town/tests/actions/test_summarize_conv.py index 9174a558a..fa0de2031 100644 --- a/examples/st_game/tests/actions/test_summarize_conv.py +++ b/examples/stanford_town/tests/actions/test_summarize_conv.py @@ -4,7 +4,7 @@ import pytest -from examples.st_game.actions.summarize_conv import SummarizeConv +from examples.stanford_town.actions.summarize_conv import SummarizeConv @pytest.mark.asyncio diff --git a/examples/st_game/tests/plan/__init__.py b/examples/stanford_town/tests/plan/__init__.py similarity index 100% rename from examples/st_game/tests/plan/__init__.py rename to examples/stanford_town/tests/plan/__init__.py diff --git a/examples/st_game/tests/plan/test_conversation.py b/examples/stanford_town/tests/plan/test_conversation.py similarity index 80% rename from examples/st_game/tests/plan/test_conversation.py rename to examples/stanford_town/tests/plan/test_conversation.py index 3a158fc5f..86c2f0b94 100644 --- a/examples/st_game/tests/plan/test_conversation.py +++ b/examples/stanford_town/tests/plan/test_conversation.py @@ -6,12 +6,12 @@ from typing import Tuple import pytest -from examples.st_game.plan.converse import agent_conversation -from examples.st_game.roles.st_role import STRole -from examples.st_game.utils.const import MAZE_ASSET_PATH, STORAGE_PATH -from examples.st_game.utils.mg_ga_transform import get_reverie_meta -from examples.st_game.utils.utils import copy_folder -from metagpt.environment.stanford_town_env.stanford_town_env import StanfordTownEnv +from examples.stanford_town.plan.converse import agent_conversation +from examples.stanford_town.roles.st_role import STRole +from examples.stanford_town.utils.const import MAZE_ASSET_PATH, STORAGE_PATH +from examples.stanford_town.utils.mg_ga_transform import get_reverie_meta +from examples.stanford_town.utils.utils import copy_folder +from metagpt.environment.stanford_town.stanford_town_env import StanfordTownEnv async def init_two_roles(fork_sim_code: str = "base_the_ville_isabella_maria_klaus") -> Tuple["STRole"]: diff --git a/examples/st_game/tests/plan/test_st_plan.py b/examples/stanford_town/tests/plan/test_st_plan.py similarity index 87% rename from examples/st_game/tests/plan/test_st_plan.py rename to examples/stanford_town/tests/plan/test_st_plan.py index 82e3c56c2..ad20d3068 100644 --- a/examples/st_game/tests/plan/test_st_plan.py +++ b/examples/stanford_town/tests/plan/test_st_plan.py @@ -4,8 +4,12 @@ import pytest -from examples.st_game.plan.st_plan import _choose_retrieved, _should_react, _wait_react -from examples.st_game.tests.plan.test_converse import init_two_roles +from examples.stanford_town.plan.st_plan import ( + _choose_retrieved, + _should_react, + _wait_react, +) +from examples.stanford_town.tests.plan.test_converse import init_two_roles def test_should_react(): diff --git a/examples/st_game/tests/roles/__init__.py b/examples/stanford_town/tests/roles/__init__.py similarity index 100% rename from examples/st_game/tests/roles/__init__.py rename to examples/stanford_town/tests/roles/__init__.py diff --git a/examples/st_game/tests/roles/test_st_role.py b/examples/stanford_town/tests/roles/test_st_role.py similarity index 67% rename from examples/st_game/tests/roles/test_st_role.py rename to examples/stanford_town/tests/roles/test_st_role.py index c0844d10c..b8feecb2a 100644 --- a/examples/st_game/tests/roles/test_st_role.py +++ b/examples/stanford_town/tests/roles/test_st_role.py @@ -4,10 +4,10 @@ import pytest -from examples.st_game.memory.agent_memory import BasicMemory -from examples.st_game.roles.st_role import STRole -from examples.st_game.utils.const import MAZE_ASSET_PATH -from metagpt.environment.stanford_town_env.stanford_town_env import StanfordTownEnv +from examples.stanford_town.memory.agent_memory import BasicMemory +from examples.stanford_town.roles.st_role import STRole +from examples.stanford_town.utils.const import MAZE_ASSET_PATH +from metagpt.environment.stanford_town.stanford_town_env import StanfordTownEnv @pytest.mark.asyncio diff --git a/examples/st_game/tests/test_agent_memory.py b/examples/stanford_town/tests/test_agent_memory.py similarity index 94% rename from examples/st_game/tests/test_agent_memory.py rename to examples/stanford_town/tests/test_agent_memory.py index d5a75163c..e7ad3fc43 100644 --- a/examples/st_game/tests/test_agent_memory.py +++ b/examples/stanford_town/tests/test_agent_memory.py @@ -6,9 +6,9 @@ from datetime import datetime, timedelta import pytest -from examples.st_game.memory.agent_memory import AgentMemory -from examples.st_game.memory.retrieve import agent_retrieve -from examples.st_game.utils.const import STORAGE_PATH +from examples.stanford_town.memory.agent_memory import AgentMemory +from examples.stanford_town.memory.retrieve import agent_retrieve +from examples.stanford_town.utils.const import STORAGE_PATH from metagpt.logs import logger """ diff --git a/examples/st_game/tests/test_basic_memory.py b/examples/stanford_town/tests/test_basic_memory.py similarity index 96% rename from examples/st_game/tests/test_basic_memory.py rename to examples/stanford_town/tests/test_basic_memory.py index 25d350263..fa2a5c487 100644 --- a/examples/st_game/tests/test_basic_memory.py +++ b/examples/stanford_town/tests/test_basic_memory.py @@ -6,7 +6,7 @@ from datetime import datetime, timedelta import pytest -from examples.st_game.memory.agent_memory import BasicMemory +from examples.stanford_town.memory.agent_memory import BasicMemory from metagpt.logs import logger """ diff --git a/examples/st_game/tests/test_reflect.py b/examples/stanford_town/tests/test_reflect.py similarity index 93% rename from examples/st_game/tests/test_reflect.py rename to examples/stanford_town/tests/test_reflect.py index 6672b0545..48422d073 100644 --- a/examples/st_game/tests/test_reflect.py +++ b/examples/stanford_town/tests/test_reflect.py @@ -4,14 +4,14 @@ import pytest -from examples.st_game.actions.run_reflect_action import ( +from examples.stanford_town.actions.run_reflect_action import ( AgentEventTriple, AgentFocusPt, AgentInsightAndGuidance, ) -from examples.st_game.roles.st_role import STRole -from examples.st_game.utils.const import MAZE_ASSET_PATH -from metagpt.environment.stanford_town_env.stanford_town_env import StanfordTownEnv +from examples.stanford_town.roles.st_role import STRole +from examples.stanford_town.utils.const import MAZE_ASSET_PATH +from metagpt.environment.stanford_town.stanford_town_env import StanfordTownEnv @pytest.mark.asyncio diff --git a/examples/st_game/tests/test_spatial_memory.py b/examples/stanford_town/tests/test_spatial_memory.py similarity index 100% rename from examples/st_game/tests/test_spatial_memory.py rename to examples/stanford_town/tests/test_spatial_memory.py diff --git a/examples/st_game/utils/__init__.py b/examples/stanford_town/utils/__init__.py similarity index 100% rename from examples/st_game/utils/__init__.py rename to examples/stanford_town/utils/__init__.py diff --git a/examples/st_game/utils/const.py b/examples/stanford_town/utils/const.py similarity index 100% rename from examples/st_game/utils/const.py rename to examples/stanford_town/utils/const.py diff --git a/examples/st_game/utils/mg_ga_transform.py b/examples/stanford_town/utils/mg_ga_transform.py similarity index 96% rename from examples/st_game/utils/mg_ga_transform.py rename to examples/stanford_town/utils/mg_ga_transform.py index 9ff57a3b1..521199a05 100644 --- a/examples/st_game/utils/mg_ga_transform.py +++ b/examples/stanford_town/utils/mg_ga_transform.py @@ -5,7 +5,7 @@ from pathlib import Path from typing import Optional -from examples.st_game.utils.const import STORAGE_PATH, TEMP_STORAGE_PATH +from examples.stanford_town.utils.const import STORAGE_PATH, TEMP_STORAGE_PATH from metagpt.logs import logger from metagpt.utils.common import read_json_file, write_json_file diff --git a/examples/st_game/utils/utils.py b/examples/stanford_town/utils/utils.py similarity index 100% rename from examples/st_game/utils/utils.py rename to examples/stanford_town/utils/utils.py diff --git a/metagpt/environment/__init__.py b/metagpt/environment/__init__.py index 28981f2f8..0621fff16 100644 --- a/metagpt/environment/__init__.py +++ b/metagpt/environment/__init__.py @@ -3,10 +3,10 @@ # @Desc : from metagpt.environment.base_env import Environment -from metagpt.environment.android_env.android_env import AndroidEnv -from metagpt.environment.werewolf_env.werewolf_env import WerewolfEnv -from metagpt.environment.stanford_town_env.stanford_town_env import StanfordTownEnv -from metagpt.environment.software_env.software_env import SoftwareEnv +from metagpt.environment.android.android_env import AndroidEnv +from metagpt.environment.werewolf.werewolf_env import WerewolfEnv +from metagpt.environment.stanford_town.stanford_town_env import StanfordTownEnv +from metagpt.environment.software.software_env import SoftwareEnv __all__ = ["AndroidEnv", "WerewolfEnv", "StanfordTownEnv", "SoftwareEnv", "Environment"] diff --git a/metagpt/environment/android_env/__init__.py b/metagpt/environment/android/__init__.py similarity index 100% rename from metagpt/environment/android_env/__init__.py rename to metagpt/environment/android/__init__.py diff --git a/metagpt/environment/android_env/android_env.py b/metagpt/environment/android/android_env.py similarity index 83% rename from metagpt/environment/android_env/android_env.py rename to metagpt/environment/android/android_env.py index c27e20541..b3227df0f 100644 --- a/metagpt/environment/android_env/android_env.py +++ b/metagpt/environment/android/android_env.py @@ -4,7 +4,7 @@ from pydantic import Field -from metagpt.environment.android_env.android_ext_env import AndroidExtEnv +from metagpt.environment.android.android_ext_env import AndroidExtEnv from metagpt.environment.base_env import Environment diff --git a/metagpt/environment/android_env/android_ext_env.py b/metagpt/environment/android/android_ext_env.py similarity index 99% rename from metagpt/environment/android_env/android_ext_env.py rename to metagpt/environment/android/android_ext_env.py index 01a24c5b9..d2344fa1f 100644 --- a/metagpt/environment/android_env/android_ext_env.py +++ b/metagpt/environment/android/android_ext_env.py @@ -8,7 +8,7 @@ from typing import Any, Optional from pydantic import Field -from metagpt.environment.android_env.const import ADB_EXEC_FAIL +from metagpt.environment.android.const import ADB_EXEC_FAIL from metagpt.environment.base_env import ExtEnv, mark_as_readable, mark_as_writeable from metagpt.environment.base_env_space import BaseEnvAction, BaseEnvObsParams diff --git a/metagpt/environment/android_env/const.py b/metagpt/environment/android/const.py similarity index 100% rename from metagpt/environment/android_env/const.py rename to metagpt/environment/android/const.py diff --git a/metagpt/environment/minecraft_env/__init__.py b/metagpt/environment/minecraft/__init__.py similarity index 100% rename from metagpt/environment/minecraft_env/__init__.py rename to metagpt/environment/minecraft/__init__.py diff --git a/metagpt/environment/minecraft_env/const.py b/metagpt/environment/minecraft/const.py similarity index 100% rename from metagpt/environment/minecraft_env/const.py rename to metagpt/environment/minecraft/const.py diff --git a/metagpt/environment/minecraft_env/minecraft_env.py b/metagpt/environment/minecraft/minecraft_env.py similarity index 99% rename from metagpt/environment/minecraft_env/minecraft_env.py rename to metagpt/environment/minecraft/minecraft_env.py index bba35ce21..edc4aca5b 100644 --- a/metagpt/environment/minecraft_env/minecraft_env.py +++ b/metagpt/environment/minecraft/minecraft_env.py @@ -12,8 +12,8 @@ from pydantic import ConfigDict, Field from metagpt.config2 import config as CONFIG from metagpt.environment.base_env import Environment -from metagpt.environment.minecraft_env.const import MC_CKPT_DIR -from metagpt.environment.minecraft_env.minecraft_ext_env import MinecraftExtEnv +from metagpt.environment.minecraft.const import MC_CKPT_DIR +from metagpt.environment.minecraft.minecraft_ext_env import MinecraftExtEnv from metagpt.logs import logger from metagpt.rag.vector_stores.chroma import ChromaVectorStore from metagpt.utils.common import load_mc_skills_code, read_json_file, write_json_file diff --git a/metagpt/environment/minecraft_env/minecraft_ext_env.py b/metagpt/environment/minecraft/minecraft_ext_env.py similarity index 97% rename from metagpt/environment/minecraft_env/minecraft_ext_env.py rename to metagpt/environment/minecraft/minecraft_ext_env.py index 74f417eb0..0436bc3aa 100644 --- a/metagpt/environment/minecraft_env/minecraft_ext_env.py +++ b/metagpt/environment/minecraft/minecraft_ext_env.py @@ -12,14 +12,14 @@ from pydantic import ConfigDict, Field, model_validator from metagpt.environment.base_env import ExtEnv, mark_as_writeable from metagpt.environment.base_env_space import BaseEnvAction, BaseEnvObsParams -from metagpt.environment.minecraft_env.const import ( +from metagpt.environment.minecraft.const import ( MC_CKPT_DIR, MC_CORE_INVENTORY_ITEMS, MC_CURRICULUM_OB, MC_DEFAULT_WARMUP, METAGPT_ROOT, ) -from metagpt.environment.minecraft_env.process_monitor import SubprocessMonitor +from metagpt.environment.minecraft.process_monitor import SubprocessMonitor from metagpt.logs import logger @@ -63,7 +63,7 @@ class MinecraftExtEnv(ExtEnv): self.mineflayer = SubprocessMonitor( commands=[ "node", - METAGPT_ROOT.joinpath("metagpt", "environment", "minecraft_env", "mineflayer", "index.js"), + METAGPT_ROOT.joinpath("metagpt", "environment", "minecraft", "mineflayer", "index.js"), str(self.server_port), ], name="mineflayer", diff --git a/metagpt/environment/minecraft_env/mineflayer/.gitignore b/metagpt/environment/minecraft/mineflayer/.gitignore similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/.gitignore rename to metagpt/environment/minecraft/mineflayer/.gitignore diff --git a/metagpt/environment/minecraft_env/mineflayer/.prettierignore b/metagpt/environment/minecraft/mineflayer/.prettierignore similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/.prettierignore rename to metagpt/environment/minecraft/mineflayer/.prettierignore diff --git a/metagpt/environment/minecraft_env/mineflayer/.prettierrc.json b/metagpt/environment/minecraft/mineflayer/.prettierrc.json similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/.prettierrc.json rename to metagpt/environment/minecraft/mineflayer/.prettierrc.json diff --git a/metagpt/environment/minecraft_env/mineflayer/index.js b/metagpt/environment/minecraft/mineflayer/index.js similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/index.js rename to metagpt/environment/minecraft/mineflayer/index.js diff --git a/metagpt/environment/minecraft_env/mineflayer/lib/observation/base.js b/metagpt/environment/minecraft/mineflayer/lib/observation/base.js similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/lib/observation/base.js rename to metagpt/environment/minecraft/mineflayer/lib/observation/base.js diff --git a/metagpt/environment/minecraft_env/mineflayer/lib/observation/chests.js b/metagpt/environment/minecraft/mineflayer/lib/observation/chests.js similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/lib/observation/chests.js rename to metagpt/environment/minecraft/mineflayer/lib/observation/chests.js diff --git a/metagpt/environment/minecraft_env/mineflayer/lib/observation/inventory.js b/metagpt/environment/minecraft/mineflayer/lib/observation/inventory.js similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/lib/observation/inventory.js rename to metagpt/environment/minecraft/mineflayer/lib/observation/inventory.js diff --git a/metagpt/environment/minecraft_env/mineflayer/lib/observation/onChat.js b/metagpt/environment/minecraft/mineflayer/lib/observation/onChat.js similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/lib/observation/onChat.js rename to metagpt/environment/minecraft/mineflayer/lib/observation/onChat.js diff --git a/metagpt/environment/minecraft_env/mineflayer/lib/observation/onError.js b/metagpt/environment/minecraft/mineflayer/lib/observation/onError.js similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/lib/observation/onError.js rename to metagpt/environment/minecraft/mineflayer/lib/observation/onError.js diff --git a/metagpt/environment/minecraft_env/mineflayer/lib/observation/onSave.js b/metagpt/environment/minecraft/mineflayer/lib/observation/onSave.js similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/lib/observation/onSave.js rename to metagpt/environment/minecraft/mineflayer/lib/observation/onSave.js diff --git a/metagpt/environment/minecraft_env/mineflayer/lib/observation/status.js b/metagpt/environment/minecraft/mineflayer/lib/observation/status.js similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/lib/observation/status.js rename to metagpt/environment/minecraft/mineflayer/lib/observation/status.js diff --git a/metagpt/environment/minecraft_env/mineflayer/lib/observation/voxels.js b/metagpt/environment/minecraft/mineflayer/lib/observation/voxels.js similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/lib/observation/voxels.js rename to metagpt/environment/minecraft/mineflayer/lib/observation/voxels.js diff --git a/metagpt/environment/minecraft_env/mineflayer/lib/skillLoader.js b/metagpt/environment/minecraft/mineflayer/lib/skillLoader.js similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/lib/skillLoader.js rename to metagpt/environment/minecraft/mineflayer/lib/skillLoader.js diff --git a/metagpt/environment/minecraft_env/mineflayer/lib/utils.js b/metagpt/environment/minecraft/mineflayer/lib/utils.js similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/lib/utils.js rename to metagpt/environment/minecraft/mineflayer/lib/utils.js diff --git a/metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/.gitignore b/metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/.gitignore similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/.gitignore rename to metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/.gitignore diff --git a/metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/LICENSE b/metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/LICENSE similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/LICENSE rename to metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/LICENSE diff --git a/metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/README.md b/metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/README.md similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/README.md rename to metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/README.md diff --git a/metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/_config.yml b/metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/_config.yml similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/_config.yml rename to metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/_config.yml diff --git a/metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/docs/api.md b/metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/docs/api.md similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/docs/api.md rename to metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/docs/api.md diff --git a/metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/examples/collector.js b/metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/examples/collector.js similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/examples/collector.js rename to metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/examples/collector.js diff --git a/metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/examples/oreMiner.js b/metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/examples/oreMiner.js similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/examples/oreMiner.js rename to metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/examples/oreMiner.js diff --git a/metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/examples/storageBot.js b/metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/examples/storageBot.js similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/examples/storageBot.js rename to metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/examples/storageBot.js diff --git a/metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/package.json b/metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/package.json similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/package.json rename to metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/package.json diff --git a/metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/src/BlockVeins.ts b/metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/src/BlockVeins.ts similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/src/BlockVeins.ts rename to metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/src/BlockVeins.ts diff --git a/metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/src/CollectBlock.ts b/metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/src/CollectBlock.ts similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/src/CollectBlock.ts rename to metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/src/CollectBlock.ts diff --git a/metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/src/Inventory.ts b/metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/src/Inventory.ts similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/src/Inventory.ts rename to metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/src/Inventory.ts diff --git a/metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/src/Targets.ts b/metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/src/Targets.ts similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/src/Targets.ts rename to metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/src/Targets.ts diff --git a/metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/src/TaskQueue.ts b/metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/src/TaskQueue.ts similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/src/TaskQueue.ts rename to metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/src/TaskQueue.ts diff --git a/metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/src/TemporarySubscriber.ts b/metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/src/TemporarySubscriber.ts similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/src/TemporarySubscriber.ts rename to metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/src/TemporarySubscriber.ts diff --git a/metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/src/Util.ts b/metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/src/Util.ts similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/src/Util.ts rename to metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/src/Util.ts diff --git a/metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/src/index.ts b/metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/src/index.ts similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/src/index.ts rename to metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/src/index.ts diff --git a/metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/tsconfig.json b/metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/tsconfig.json similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/mineflayer-collectblock/tsconfig.json rename to metagpt/environment/minecraft/mineflayer/mineflayer-collectblock/tsconfig.json diff --git a/metagpt/environment/minecraft_env/mineflayer/package.json b/metagpt/environment/minecraft/mineflayer/package.json similarity index 100% rename from metagpt/environment/minecraft_env/mineflayer/package.json rename to metagpt/environment/minecraft/mineflayer/package.json diff --git a/metagpt/environment/minecraft_env/process_monitor.py b/metagpt/environment/minecraft/process_monitor.py similarity index 100% rename from metagpt/environment/minecraft_env/process_monitor.py rename to metagpt/environment/minecraft/process_monitor.py diff --git a/metagpt/environment/software_env/__init__.py b/metagpt/environment/software/__init__.py similarity index 100% rename from metagpt/environment/software_env/__init__.py rename to metagpt/environment/software/__init__.py diff --git a/metagpt/environment/software_env/software_env.py b/metagpt/environment/software/software_env.py similarity index 100% rename from metagpt/environment/software_env/software_env.py rename to metagpt/environment/software/software_env.py diff --git a/metagpt/environment/stanford_town_env/__init__.py b/metagpt/environment/stanford_town/__init__.py similarity index 100% rename from metagpt/environment/stanford_town_env/__init__.py rename to metagpt/environment/stanford_town/__init__.py diff --git a/metagpt/environment/stanford_town_env/env_space.py b/metagpt/environment/stanford_town/env_space.py similarity index 100% rename from metagpt/environment/stanford_town_env/env_space.py rename to metagpt/environment/stanford_town/env_space.py diff --git a/metagpt/environment/stanford_town_env/stanford_town_env.py b/metagpt/environment/stanford_town/stanford_town_env.py similarity index 66% rename from metagpt/environment/stanford_town_env/stanford_town_env.py rename to metagpt/environment/stanford_town/stanford_town_env.py index 8721d6cd1..2b6212781 100644 --- a/metagpt/environment/stanford_town_env/stanford_town_env.py +++ b/metagpt/environment/stanford_town/stanford_town_env.py @@ -3,9 +3,7 @@ # @Desc : MG StanfordTown Env from metagpt.environment.base_env import Environment -from metagpt.environment.stanford_town_env.stanford_town_ext_env import ( - StanfordTownExtEnv, -) +from metagpt.environment.stanford_town.stanford_town_ext_env import StanfordTownExtEnv class StanfordTownEnv(Environment, StanfordTownExtEnv): diff --git a/metagpt/environment/stanford_town_env/stanford_town_ext_env.py b/metagpt/environment/stanford_town/stanford_town_ext_env.py similarity index 99% rename from metagpt/environment/stanford_town_env/stanford_town_ext_env.py rename to metagpt/environment/stanford_town/stanford_town_ext_env.py index b41ae375c..30a02d4db 100644 --- a/metagpt/environment/stanford_town_env/stanford_town_ext_env.py +++ b/metagpt/environment/stanford_town/stanford_town_ext_env.py @@ -10,7 +10,7 @@ from typing import Any, Optional from pydantic import ConfigDict, Field, model_validator from metagpt.environment.base_env import ExtEnv, mark_as_readable, mark_as_writeable -from metagpt.environment.stanford_town_env.env_space import ( +from metagpt.environment.stanford_town.env_space import ( EnvAction, EnvActionType, EnvObsParams, diff --git a/metagpt/environment/werewolf_env/__init__.py b/metagpt/environment/werewolf/__init__.py similarity index 100% rename from metagpt/environment/werewolf_env/__init__.py rename to metagpt/environment/werewolf/__init__.py diff --git a/metagpt/environment/werewolf_env/werewolf_env.py b/metagpt/environment/werewolf/werewolf_env.py similarity index 93% rename from metagpt/environment/werewolf_env/werewolf_env.py rename to metagpt/environment/werewolf/werewolf_env.py index d174f322c..e22d9c46f 100644 --- a/metagpt/environment/werewolf_env/werewolf_env.py +++ b/metagpt/environment/werewolf/werewolf_env.py @@ -5,7 +5,7 @@ from pydantic import Field from metagpt.environment.base_env import Environment -from metagpt.environment.werewolf_env.werewolf_ext_env import WerewolfExtEnv +from metagpt.environment.werewolf.werewolf_ext_env import WerewolfExtEnv from metagpt.logs import logger from metagpt.schema import Message diff --git a/metagpt/environment/werewolf_env/werewolf_ext_env.py b/metagpt/environment/werewolf/werewolf_ext_env.py similarity index 100% rename from metagpt/environment/werewolf_env/werewolf_ext_env.py rename to metagpt/environment/werewolf/werewolf_ext_env.py diff --git a/tests/metagpt/environment/android_env/test_android_ext_env.py b/tests/metagpt/environment/android_env/test_android_ext_env.py index c9dfc718b..3fb77ab24 100644 --- a/tests/metagpt/environment/android_env/test_android_ext_env.py +++ b/tests/metagpt/environment/android_env/test_android_ext_env.py @@ -4,8 +4,8 @@ from pathlib import Path -from metagpt.environment.android_env.android_ext_env import AndroidExtEnv -from metagpt.environment.android_env.const import ADB_EXEC_FAIL +from metagpt.environment.android.android_ext_env import AndroidExtEnv +from metagpt.environment.android.const import ADB_EXEC_FAIL def mock_device_shape(self, adb_cmd: str) -> str: @@ -34,9 +34,7 @@ def mock_write_read_operation(self, adb_cmd: str) -> str: def test_android_ext_env(mocker): device_id = "emulator-5554" - mocker.patch( - "metagpt.environment.android_env.android_ext_env.AndroidExtEnv.execute_adb_with_cmd", mock_device_shape - ) + mocker.patch("metagpt.environment.android.android_ext_env.AndroidExtEnv.execute_adb_with_cmd", mock_device_shape) ext_env = AndroidExtEnv(device_id=device_id, screenshot_dir="/data2/", xml_dir="/data2/") assert ext_env.adb_prefix == f"adb -s {device_id} " @@ -46,25 +44,21 @@ def test_android_ext_env(mocker): assert ext_env.device_shape == (720, 1080) mocker.patch( - "metagpt.environment.android_env.android_ext_env.AndroidExtEnv.execute_adb_with_cmd", mock_device_shape_invalid + "metagpt.environment.android.android_ext_env.AndroidExtEnv.execute_adb_with_cmd", mock_device_shape_invalid ) assert ext_env.device_shape == (0, 0) - mocker.patch( - "metagpt.environment.android_env.android_ext_env.AndroidExtEnv.execute_adb_with_cmd", mock_list_devices - ) + mocker.patch("metagpt.environment.android.android_ext_env.AndroidExtEnv.execute_adb_with_cmd", mock_list_devices) assert ext_env.list_devices() == [device_id] - mocker.patch( - "metagpt.environment.android_env.android_ext_env.AndroidExtEnv.execute_adb_with_cmd", mock_get_screenshot - ) + mocker.patch("metagpt.environment.android.android_ext_env.AndroidExtEnv.execute_adb_with_cmd", mock_get_screenshot) assert ext_env.get_screenshot("screenshot_xxxx-xx-xx", "/data/") == Path("/data/screenshot_xxxx-xx-xx.png") - mocker.patch("metagpt.environment.android_env.android_ext_env.AndroidExtEnv.execute_adb_with_cmd", mock_get_xml) + mocker.patch("metagpt.environment.android.android_ext_env.AndroidExtEnv.execute_adb_with_cmd", mock_get_xml) assert ext_env.get_xml("xml_xxxx-xx-xx", "/data/") == Path("/data/xml_xxxx-xx-xx.xml") mocker.patch( - "metagpt.environment.android_env.android_ext_env.AndroidExtEnv.execute_adb_with_cmd", mock_write_read_operation + "metagpt.environment.android.android_ext_env.AndroidExtEnv.execute_adb_with_cmd", mock_write_read_operation ) res = "OK" assert ext_env.system_back() == res diff --git a/tests/metagpt/environment/minecraft_env/test_minecraft_ext_env.py b/tests/metagpt/environment/minecraft_env/test_minecraft_ext_env.py index ed08b719f..0ebff22eb 100644 --- a/tests/metagpt/environment/minecraft_env/test_minecraft_ext_env.py +++ b/tests/metagpt/environment/minecraft_env/test_minecraft_ext_env.py @@ -3,8 +3,8 @@ # @Desc : the unittest of MinecraftExtEnv -from metagpt.environment.minecraft_env.const import MC_CKPT_DIR -from metagpt.environment.minecraft_env.minecraft_ext_env import MinecraftExtEnv +from metagpt.environment.minecraft.const import MC_CKPT_DIR +from metagpt.environment.minecraft.minecraft_ext_env import MinecraftExtEnv def test_minecraft_ext_env(): diff --git a/tests/metagpt/environment/stanford_town_env/test_stanford_town_ext_env.py b/tests/metagpt/environment/stanford_town_env/test_stanford_town_ext_env.py index 63e88cf32..81c811d67 100644 --- a/tests/metagpt/environment/stanford_town_env/test_stanford_town_ext_env.py +++ b/tests/metagpt/environment/stanford_town_env/test_stanford_town_ext_env.py @@ -4,18 +4,18 @@ from pathlib import Path -from metagpt.environment.stanford_town_env.env_space import ( +from metagpt.environment.stanford_town.env_space import ( EnvAction, EnvActionType, EnvObsParams, EnvObsType, ) -from metagpt.environment.stanford_town_env.stanford_town_ext_env import ( - StanfordTownExtEnv, -) +from metagpt.environment.stanford_town.stanford_town_ext_env import StanfordTownExtEnv maze_asset_path = ( - Path(__file__).absolute().parent.joinpath("..", "..", "..", "..", "examples/st_game/static_dirs/assets/the_ville") + Path(__file__) + .absolute() + .parent.joinpath("..", "..", "..", "..", "examples/stanford_town/static_dirs/assets/the_ville") ) diff --git a/tests/metagpt/environment/werewolf_env/test_werewolf_ext_env.py b/tests/metagpt/environment/werewolf_env/test_werewolf_ext_env.py index 0694c5c3d..433f59f2c 100644 --- a/tests/metagpt/environment/werewolf_env/test_werewolf_ext_env.py +++ b/tests/metagpt/environment/werewolf_env/test_werewolf_ext_env.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # @Desc : the unittest of WerewolfExtEnv -from metagpt.environment.werewolf_env.werewolf_ext_env import RoleState, WerewolfExtEnv +from metagpt.environment.werewolf.werewolf_ext_env import RoleState, WerewolfExtEnv from metagpt.roles.role import Role