pycityagent 2.0.0a87__cp310-cp310-macosx_11_0_arm64.whl → 2.0.0a88__cp310-cp310-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.
@@ -167,16 +167,19 @@ class MonthPlanBlock(Block):
167
167
  "UBI",
168
168
  "num_labor_hours",
169
169
  "productivity_per_labor",
170
+ "time_diff"
170
171
  ]
171
172
  default_values = {
172
173
  "UBI": 0,
173
174
  "num_labor_hours": 168,
174
175
  "productivity_per_labor": 1,
176
+ "time_diff": 30 * 24 * 60 * 60
175
177
  }
176
178
  fields_description = {
177
179
  "UBI": "Universal Basic Income",
178
180
  "num_labor_hours": "Number of labor hours per month",
179
181
  "productivity_per_labor": "Productivity per labor hour",
182
+ "time_diff": "Time difference between two triggers"
180
183
  }
181
184
 
182
185
  def __init__(self, llm: LLM, memory: Memory, simulator: Simulator, economy_client: EconomyClient):
@@ -184,14 +187,13 @@ class MonthPlanBlock(Block):
184
187
  self.economy_client = economy_client
185
188
  self.llm_error = 0
186
189
  self.last_time_trigger = None
187
- self.time_diff = 30 * 24 * 60 * 60
188
190
  self.forward_times = 0
189
191
 
190
192
  # configurable fields
191
193
  self.UBI = 0
192
194
  self.num_labor_hours = 168
193
195
  self.productivity_per_labor = 1
194
-
196
+ self.time_diff = 30 * 24 * 60 * 60
195
197
 
196
198
  async def month_trigger(self):
197
199
  now_time = await self.simulator.get_time()
@@ -254,11 +256,11 @@ class MonthPlanBlock(Block):
254
256
  Any other output words are NOT allowed.
255
257
  '''
256
258
  obs_prompt = prettify_document(obs_prompt)
257
- await self.memory.status.update('dialog_queue', [{'role': 'user', 'content': obs_prompt}], mode='merge')
258
- dialog_queue = await self.memory.status.get('dialog_queue')
259
- content = await self.llm.atext_request(list(dialog_queue), timeout=300)
260
- await self.memory.status.update('dialog_queue', [{'role': 'assistant', 'content': content}], mode='merge')
261
259
  try:
260
+ await self.memory.status.update('dialog_queue', [{'role': 'user', 'content': obs_prompt}], mode='merge')
261
+ dialog_queue = await self.memory.status.get('dialog_queue')
262
+ content = await self.llm.atext_request(list(dialog_queue), timeout=300)
263
+ await self.memory.status.update('dialog_queue', [{'role': 'assistant', 'content': content}], mode='merge')
262
264
  propensity_dict = extract_dict_from_string(content)[0]
263
265
  work_propensity, consumption_propensity = propensity_dict['work'], propensity_dict['consumption']
264
266
  if isinstance(work_propensity, numbers.Number) and isinstance(consumption_propensity, numbers.Number):
pycityagent/llm/llm.py CHANGED
@@ -203,7 +203,7 @@ class LLM:
203
203
  frequency_penalty: Optional[float] = None,
204
204
  presence_penalty: Optional[float] = None,
205
205
  timeout: int = 300,
206
- retries=3,
206
+ retries=10,
207
207
  tools: Optional[list[dict[str, Any]]] = None,
208
208
  tool_choice: Optional[dict[str, Any]] = None,
209
209
  ):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pycityagent
3
- Version: 2.0.0a87
3
+ Version: 2.0.0a88
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
@@ -1,3 +1,9 @@
1
+ pycityagent-2.0.0a88.dist-info/RECORD,,
2
+ pycityagent-2.0.0a88.dist-info/LICENSE,sha256=n2HPXiupinpyHMnIkbCf3OTYd3KMqbmldu1e7av0CAU,1084
3
+ pycityagent-2.0.0a88.dist-info/WHEEL,sha256=ezfKMaDztqf77C8lvQ0NCnZxkTaOaKLprqJ8q932MhU,109
4
+ pycityagent-2.0.0a88.dist-info/entry_points.txt,sha256=BZcne49AAIFv-hawxGnPbblea7X3MtAtoPyDX8L4OC4,132
5
+ pycityagent-2.0.0a88.dist-info/top_level.txt,sha256=yOmeu6cSXmiUtScu53a3s0p7BGtLMaV0aff83EHCTic,43
6
+ pycityagent-2.0.0a88.dist-info/METADATA,sha256=RX-Ot6Yyl_W0-bl9cJur9nQVLlAoI3WQ2YKiz37qTwk,9110
1
7
  pycityagent/pycityagent-sim,sha256=Ax6cjHjT8VcT5t07VboL_Ruor2eXSdSEml4Jvv-L5dQ,36972594
2
8
  pycityagent/__init__.py,sha256=PUKWTXc-xdMG7px8oTNclodsILUgypANj2Z647sY63k,808
3
9
  pycityagent/pycityagent-ui,sha256=Ur95yZygIaZ5l_CDqP9394M5GQ66iV5PkcNPYFWqzvk,41225346
@@ -9,7 +15,7 @@ pycityagent/tools/__init__.py,sha256=y7sMVMHf0AbivlczM2h-kr7mkgXK-WAx3S9BXLXkWvw
9
15
  pycityagent/tools/tool.py,sha256=4ZJSHbNM8dfAVwZEw8T0a2_9OuPsPQpKSVL4WxZVBUc,9022
10
16
  pycityagent/llm/llmconfig.py,sha256=6AqCMV4B_JqBD2mb98bLGzpUdlOCnziQKae-Hhxxp-E,469
11
17
  pycityagent/llm/__init__.py,sha256=iWs6FLgrbRVIiqOf4ILS89gkVCTvS7HFC3vG-MWuyko,205
12
- pycityagent/llm/llm.py,sha256=A1Q-dKEXHJKhBnElI7Ci6eIK-A7I-UZNQxC_hEgEa-4,20018
18
+ pycityagent/llm/llm.py,sha256=vMw9AVftrsmbGkhRIwJ7jftFWpzTofhfQmu7TazDCaQ,20019
13
19
  pycityagent/llm/embeddings.py,sha256=3610I-_scAy8HwRNpT8hVJpH9_8_pTLCPptqnzSq10o,11322
14
20
  pycityagent/llm/utils.py,sha256=rSx_fp-_Gh0vZ-x2rqAUqnpS56BVTZ4ChfAMarB8S1A,195
15
21
  pycityagent/memory/memory.py,sha256=5mUweo-BgQYbXmVRAk7HTUXsar6O6iYz79VbLuMAvjo,45063
@@ -81,7 +87,7 @@ pycityagent/cityagent/blocks/needs_block.py,sha256=NYKrGDoYCuXoupMNMuSNhx4Ci1paC
81
87
  pycityagent/cityagent/blocks/cognition_block.py,sha256=yzjB0D_95vytpa5xiVdmTSpGp8H9HXcjWzzFN0OpP0k,15398
82
88
  pycityagent/cityagent/blocks/social_block.py,sha256=eedOlwRTGI47QFELYmfe2a_aj0GuHJweSyDxA6AYXcU,15493
83
89
  pycityagent/cityagent/blocks/__init__.py,sha256=h6si6WBcVVuglIskKQKA8Cxtf_VKen1sNPqOFKI311Q,420
84
- pycityagent/cityagent/blocks/economy_block.py,sha256=ZhNzhkXxzFidQQRLS5jNv5msHSdoASouKBqvAzecJU4,19709
90
+ pycityagent/cityagent/blocks/economy_block.py,sha256=l47x2Iq15Rjj9WsH3p398dtpcejat4aCkC3X160xBlE,19843
85
91
  pycityagent/cityagent/blocks/utils.py,sha256=K--6odjUDUu9YrwrHPaiPIHryo7m_MBmcBqDAy3cV5M,1816
86
92
  pycityagent/cityagent/blocks/other_block.py,sha256=LdtL6248xvMvvRQx6NvdlJrWWZFu8Xusjxb9yEh1M0k,4365
87
93
  pycityagent/cityagent/blocks/plan_block.py,sha256=A5DvtXIy98MZkRGUQmp26grNI5i0BVbl3aEM_Ebd6Z4,11271
@@ -89,9 +95,3 @@ pycityagent/cityagent/blocks/mobility_block.py,sha256=qkRiV0nkGOUUoo9lGIjAFE_Hl0
89
95
  pycityagent/survey/models.py,sha256=g3xni4GcA1Py3vlGt6z4ltutjgQ4G0uINYAM8vKRJAw,5225
90
96
  pycityagent/survey/__init__.py,sha256=rxwou8U9KeFSP7rMzXtmtp2fVFZxK4Trzi-psx9LPIs,153
91
97
  pycityagent/survey/manager.py,sha256=tHkdeq4lTfAHwvgf4-udsXri0z2l6E00rEbvwl7SqRs,3439
92
- pycityagent-2.0.0a87.dist-info/RECORD,,
93
- pycityagent-2.0.0a87.dist-info/LICENSE,sha256=n2HPXiupinpyHMnIkbCf3OTYd3KMqbmldu1e7av0CAU,1084
94
- pycityagent-2.0.0a87.dist-info/WHEEL,sha256=ezfKMaDztqf77C8lvQ0NCnZxkTaOaKLprqJ8q932MhU,109
95
- pycityagent-2.0.0a87.dist-info/entry_points.txt,sha256=BZcne49AAIFv-hawxGnPbblea7X3MtAtoPyDX8L4OC4,132
96
- pycityagent-2.0.0a87.dist-info/top_level.txt,sha256=yOmeu6cSXmiUtScu53a3s0p7BGtLMaV0aff83EHCTic,43
97
- pycityagent-2.0.0a87.dist-info/METADATA,sha256=nhB__BcNLDfb1PCA7Wjb5GWYo7mRegc1KPQFypOERlk,9110