mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-11 00:32:37 +02:00
rename folder
This commit is contained in:
parent
9088873860
commit
bc494b2d27
166 changed files with 105 additions and 115 deletions
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"kw_strength_event": {},
|
||||
"kw_strength_thought": {}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
{}
|
||||
|
|
@ -1 +0,0 @@
|
|||
{}
|
||||
|
|
@ -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`
|
||||
|
|
@ -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`
|
||||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
@ -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(
|
||||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
@ -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,
|
||||
)
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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"]:
|
||||
|
|
@ -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():
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue