pycityagent 2.0.0a95__cp312-cp312-macosx_11_0_arm64.whl → 2.0.0a96__cp312-cp312-macosx_11_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -260,20 +260,16 @@ class Agent(ABC):
260
260
  - Recursively updates or creates top-level Blocks as specified in the configuration.
261
261
  - Raises a `KeyError` if a required Block is not found in the agent.
262
262
  """
263
- # 使用配置更新当前Agent实例的Block层次结构。
264
- # 更新当前Agent的基础参数
265
263
  for field in self.configurable_fields:
266
264
  if field in config["config"]:
267
265
  if config["config"][field] != "default_value":
268
266
  setattr(self, field, config["config"][field])
269
267
 
270
- # 递归更新或创建顶层Block
271
268
  for block_data in config.get("blocks", []):
272
269
  block_name = block_data["name"]
273
270
  existing_block = getattr(self, block_name, None) # type:ignore
274
271
 
275
272
  if existing_block:
276
- # 如果Block已经存在,则递归更新
277
273
  existing_block.load_from_config(block_data)
278
274
  else:
279
275
  raise KeyError(
@@ -29,7 +29,7 @@ class AgentConfig(BaseModel):
29
29
  number_of_nbs: int = Field(1, description="Number of neighborhood-based services")
30
30
  group_size: int = Field(100, description="Size of agent groups")
31
31
  embedding_model: Any = Field(None, description="Embedding model")
32
- agent_class_configs: Optional[dict[Any, dict[str, list[dict]]]] = None
32
+ agent_class_configs: Optional[dict[Any, dict[str, Any]]] = None
33
33
  memory_config_func: Optional[dict[type["Any"], Callable]] = None
34
34
  memory_config_init_func: Optional[Callable] = Field(None)
35
35
  init_func: Optional[list[Callable[["AgentSimulation"], None]]] = None
@@ -47,7 +47,7 @@ class AgentConfig(BaseModel):
47
47
  number_of_nbs: int = 1,
48
48
  group_size: int = 100,
49
49
  embedding_model: Any = None,
50
- agent_class_configs: Optional[dict[Any, dict[str, list[dict]]]] = None,
50
+ agent_class_configs: Optional[dict[Any, dict[str, Any]]] = None,
51
51
  enable_institution: bool = True,
52
52
  memory_config_func: Optional[dict[type["Any"], Callable]] = None,
53
53
  memory_config_init_func: Optional[Callable] = None,
@@ -192,7 +192,7 @@ class AgentGroup:
192
192
  self.agent_config_file is not None
193
193
  and self.agent_config_file[agent_class_i]
194
194
  ):
195
- agent.load_from_file(self.agent_config_file[agent_class_i])
195
+ agent.load_from_config(self.agent_config_file[agent_class_i])
196
196
  if self._message_interceptor is not None:
197
197
  agent.set_message_interceptor(self._message_interceptor)
198
198
  self.agents.append(agent)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pycityagent
3
- Version: 2.0.0a95
3
+ Version: 2.0.0a96
4
4
  Summary: LLM-based city environment agent building library
5
5
  Author-email: Yuwei Yan <pinkgranite86@gmail.com>, Junbo Yan <yanjb20thu@gmali.com>, Jun Zhang <zhangjun990222@gmali.com>
6
6
  License: MIT License
@@ -20,7 +20,7 @@ pycityagent/memory/faiss_query.py,sha256=KPeyzIjD0dzkxr-TlOeCiIlkdh1WAyyipCAXUEt
20
20
  pycityagent/memory/state.py,sha256=JFCBuK1AS-HqscvdGS9ATF9AUU8t29_2leDY_6iO2_4,5158
21
21
  pycityagent/simulation/simulation.py,sha256=GrD5VWaEvrKrBFwhEKUUfQfk2rweTEZnROaBZJXSni0,47134
22
22
  pycityagent/simulation/__init__.py,sha256=u1WpgwVxPboXWMxrUQKMXJNmTKQYAeCaqZv9HmSxESY,118
23
- pycityagent/simulation/agentgroup.py,sha256=JFDEywmFziq-I8aUDZ3QhVD8cXliVsUSav482BmPDO4,36812
23
+ pycityagent/simulation/agentgroup.py,sha256=DYx68TckA5ox9x_GHID-3Gg19qABY-NR9QAO2BKKfMc,36814
24
24
  pycityagent/simulation/storage/pg.py,sha256=xRshSOGttW-p0re0fNBOjOpb-nQ5msIE2LsdT79_E_Y,8425
25
25
  pycityagent/message/message_interceptor.py,sha256=Z7I1vqs4BrKadPAtQi-nfbkgboBAflXDSIcbIpDAxB8,17777
26
26
  pycityagent/message/__init__.py,sha256=f5QH7DKPqEAMyfSlBMnl3uouOKlsoel909STlIe7nUk,276
@@ -35,7 +35,7 @@ pycityagent/utils/parsers/__init__.py,sha256=AN2xgiPxszWK4rpX7zrqRsqNwfGF3WnCA5-
35
35
  pycityagent/utils/parsers/code_block_parser.py,sha256=jy6wHx9zypvJTWneCKuUaLQL19d4yLK6C_awc7y8A-k,1179
36
36
  pycityagent/utils/parsers/parser_base.py,sha256=ZbqRcqOBL9hfHVZSltQSQmJnWrtuJS9aYeOJU-FlJ0E,1725
37
37
  pycityagent/utils/parsers/json_parser.py,sha256=sakKohUuMcUH2toR85CAG_37D02ZoAn6LlzLgftUjmo,2923
38
- pycityagent/agent/agent_base.py,sha256=MM_kBWheTk9Y3pKoDo6Yl1Bvn2usT6v2icloYx_ykCM,39467
38
+ pycityagent/agent/agent_base.py,sha256=Fmp9wYwiDskEQxslweO3Jc-1OwbB9vgjv1VfZZIHSGI,39252
39
39
  pycityagent/agent/__init__.py,sha256=U20yKu9QwSqAx_PHk5JwipfODkDfxONtumVfnsKjWFg,180
40
40
  pycityagent/agent/agent.py,sha256=zJs09Tzz53av59SzmrlJj6Yd-XId6voCYaxguLbbq3s,18991
41
41
  pycityagent/cli/wrapper.py,sha256=bAwmfWTXbGld-uiMnIMhKp22IVRQjhLUToknyUDk9rQ,1147
@@ -43,7 +43,7 @@ pycityagent/workflow/__init__.py,sha256=WVBMF-UT3iOBoyFihRrkeqAyLvD_Iibn2axAPOIM
43
43
  pycityagent/workflow/prompt.py,sha256=rzenP4EFGxbWE1aq-x2036b6umKvi5cQx2xtWULwgIk,3392
44
44
  pycityagent/workflow/block.py,sha256=phr5julVru-Yv-oWyUNMNmm4okhPMNZIF7Up71aoUY0,12249
45
45
  pycityagent/workflow/trigger.py,sha256=4nzAwywGQsFabgo6gzp-vD2EV4wII7Z0LHGEAsflSEY,7608
46
- pycityagent/configs/exp_config.py,sha256=D_OyUBxBx-I5Eyaot52Kl6hb5wEvF5CjwcBUDM6agG8,7319
46
+ pycityagent/configs/exp_config.py,sha256=5cVEfCgBQIXNeidXttvRw31wDIlksWGiwcB0JbyHMb8,7305
47
47
  pycityagent/configs/__init__.py,sha256=JAvFkZ6yKTtWvkgO2FaeQfpR-NsStDZPadLH9FOIROU,486
48
48
  pycityagent/configs/utils.py,sha256=ILVL5wjLJqxyBVGkV1QOkqp4b9EulSmNrNbD0JQIVqc,429
49
49
  pycityagent/configs/sim_config.py,sha256=cCdVu0IypmyOEeWiOLsocL7y7d8uBnLjXsH4_t-pXDk,8209
@@ -93,9 +93,9 @@ pycityagent/cityagent/blocks/mobility_block.py,sha256=rrWzJO6mCMxUFfl1txOqq9BY7F
93
93
  pycityagent/survey/models.py,sha256=g3xni4GcA1Py3vlGt6z4ltutjgQ4G0uINYAM8vKRJAw,5225
94
94
  pycityagent/survey/__init__.py,sha256=rxwou8U9KeFSP7rMzXtmtp2fVFZxK4Trzi-psx9LPIs,153
95
95
  pycityagent/survey/manager.py,sha256=QZEApC6tKe-g1waDa_O4Eg4CFkyL8KWa7tUGZnT_7WI,3397
96
- pycityagent-2.0.0a95.dist-info/RECORD,,
97
- pycityagent-2.0.0a95.dist-info/LICENSE,sha256=n2HPXiupinpyHMnIkbCf3OTYd3KMqbmldu1e7av0CAU,1084
98
- pycityagent-2.0.0a95.dist-info/WHEEL,sha256=VujM3ypTCyUW6hcTDdK2ej0ARVMxlU1Djlh_zWnDgqk,109
99
- pycityagent-2.0.0a95.dist-info/entry_points.txt,sha256=BZcne49AAIFv-hawxGnPbblea7X3MtAtoPyDX8L4OC4,132
100
- pycityagent-2.0.0a95.dist-info/top_level.txt,sha256=yOmeu6cSXmiUtScu53a3s0p7BGtLMaV0aff83EHCTic,43
101
- pycityagent-2.0.0a95.dist-info/METADATA,sha256=WUcWf5gbldc2LyaR71a_QS8cZuGgUs9q0hrbXOdZ8_o,8657
96
+ pycityagent-2.0.0a96.dist-info/RECORD,,
97
+ pycityagent-2.0.0a96.dist-info/LICENSE,sha256=n2HPXiupinpyHMnIkbCf3OTYd3KMqbmldu1e7av0CAU,1084
98
+ pycityagent-2.0.0a96.dist-info/WHEEL,sha256=VujM3ypTCyUW6hcTDdK2ej0ARVMxlU1Djlh_zWnDgqk,109
99
+ pycityagent-2.0.0a96.dist-info/entry_points.txt,sha256=BZcne49AAIFv-hawxGnPbblea7X3MtAtoPyDX8L4OC4,132
100
+ pycityagent-2.0.0a96.dist-info/top_level.txt,sha256=yOmeu6cSXmiUtScu53a3s0p7BGtLMaV0aff83EHCTic,43
101
+ pycityagent-2.0.0a96.dist-info/METADATA,sha256=DAlWpG0FCdi2l-ae2kPICBXklMtezwsG1H_lFKHpi2E,8657