pycityagent 2.0.0a38__py3-none-any.whl → 2.0.0a40__py3-none-any.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.
@@ -199,11 +199,40 @@ class AgentGroup:
199
199
  profile = profile[0]
200
200
  profile["id"] = agent._uuid
201
201
  profiles.append(
202
- (agent._uuid, profile.get("name", ""), json.dumps(profile))
202
+ (
203
+ agent._uuid,
204
+ profile.get("name", ""),
205
+ json.dumps(
206
+ {
207
+ k: v
208
+ for k, v in profile.items()
209
+ if k not in {"id", "name"}
210
+ }
211
+ ),
212
+ )
203
213
  )
204
- await self._pgsql_writer.async_write_profile.remote( # type:ignore
205
- profiles
206
- )
214
+ else:
215
+ profiles: list[Any] = []
216
+ for agent in self.agents:
217
+ profile = await agent.memory._profile.export()
218
+ profile = profile[0]
219
+ profile["id"] = agent._uuid
220
+ profiles.append(
221
+ (
222
+ agent._uuid,
223
+ profile.get("name", ""),
224
+ json.dumps(
225
+ {
226
+ k: v
227
+ for k, v in profile.items()
228
+ if k not in {"id", "name"}
229
+ }
230
+ ),
231
+ )
232
+ )
233
+ await self._pgsql_writer.async_write_profile.remote( # type:ignore
234
+ profiles
235
+ )
207
236
  self.initialized = True
208
237
  logger.debug(f"-----AgentGroup {self._uuid} initialized")
209
238
 
@@ -139,7 +139,12 @@ class PgWriter:
139
139
  exec_str = "SELECT * FROM {table_name} WHERE id=%s".format(
140
140
  table_name=table_name
141
141
  ), (self.exp_id,)
142
- await cur.execute(exec_str) # type:ignore
142
+ await cur.execute(
143
+ "SELECT * FROM {table_name} WHERE id=%s".format(
144
+ table_name=table_name
145
+ ),
146
+ (self.exp_id,),
147
+ ) # type:ignore
143
148
  logger.debug(f"table:{table_name} sql: {exec_str}")
144
149
  record_exists = await cur.fetchall()
145
150
  if record_exists:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycityagent
3
- Version: 2.0.0a38
3
+ Version: 2.0.0a40
4
4
  Summary: LLM-based城市环境agent构建库
5
5
  License: MIT
6
6
  Author: Yuwei Yan
@@ -50,9 +50,9 @@ pycityagent/metrics/__init__.py,sha256=X08PaBbGVAd7_PRGLREXWxaqm7nS82WBQpD1zvQzc
50
50
  pycityagent/metrics/mlflow_client.py,sha256=g_tHxWkWTDijtbGL74-HmiYzWVKb1y8-w12QrY9jL30,4449
51
51
  pycityagent/metrics/utils/const.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
52
  pycityagent/simulation/__init__.py,sha256=P5czbcg2d8S0nbbnsQXFIhwzO4CennAhZM8OmKvAeYw,194
53
- pycityagent/simulation/agentgroup.py,sha256=e6K388TzfwBDyZmfPAxLl_Z1eKcyEn3qgvSlbyw-ggI,24158
53
+ pycityagent/simulation/agentgroup.py,sha256=ZPzgHgin-XOz3owxMbyAxcz8AiU4I6XM-ppOUsFsAIE,25284
54
54
  pycityagent/simulation/simulation.py,sha256=aE-U9wEay9ksheSOotxyLfZOGxlKxP0OFOuRt3mDmSY,23246
55
- pycityagent/simulation/storage/pg.py,sha256=UuBO0J7e1Oi2LsWygIiSHQ9W-RQO4X7Vpy9Ci0aMP8s,8272
55
+ pycityagent/simulation/storage/pg.py,sha256=jjdYvqKmDms3weqALqOO__gxWF-Z0YcqeD85XbP4Qks,8455
56
56
  pycityagent/survey/__init__.py,sha256=rxwou8U9KeFSP7rMzXtmtp2fVFZxK4Trzi-psx9LPIs,153
57
57
  pycityagent/survey/manager.py,sha256=S5IkwTdelsdtZETChRcfCEczzwSrry_Fly9MY4s3rbk,1681
58
58
  pycityagent/survey/models.py,sha256=YE50UUt5qJ0O_lIUsSY6XFCGUTkJVNu_L1gAhaCJ2fs,3546
@@ -70,6 +70,6 @@ pycityagent/workflow/block.py,sha256=C2aWdVRffb3LknP955GvPcBMsm3VPXN9ZuAtCgITFTo
70
70
  pycityagent/workflow/prompt.py,sha256=6jI0Rq54JLv3-IXqZLYug62vse10wTI83xvf4ZX42nk,2929
71
71
  pycityagent/workflow/tool.py,sha256=xADxhNgVsjNiMxlhdwn3xGUstFOkLEG8P67ez8VmwSI,8555
72
72
  pycityagent/workflow/trigger.py,sha256=Df-MOBEDWBbM-v0dFLQLXteLsipymT4n8vqexmK2GiQ,5643
73
- pycityagent-2.0.0a38.dist-info/METADATA,sha256=HUMRqZM9uvEGwXX9uD0ELpw5HkB6MwgZaKHmJmlxSos,8046
74
- pycityagent-2.0.0a38.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
75
- pycityagent-2.0.0a38.dist-info/RECORD,,
73
+ pycityagent-2.0.0a40.dist-info/METADATA,sha256=ZgQbu-AdFrvCiiQJ0Cgs9dILTtHOIqs5VEMfbQ1SFn0,8046
74
+ pycityagent-2.0.0a40.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
75
+ pycityagent-2.0.0a40.dist-info/RECORD,,