pycityagent 1.0.0__py3-none-any.whl → 1.1.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycityagent
3
- Version: 1.0.0
3
+ Version: 1.1.1
4
4
  Summary: LLM-based城市模拟器agent构建库
5
5
  Author-email: Yuwei Yan <pinkgranite86@gmail.com>
6
6
  License: MIT License
@@ -39,7 +39,7 @@ Requires-Dist: geojson >=3.1.0
39
39
  Requires-Dist: numpy >=1.26.3
40
40
  Requires-Dist: openai >=1.8.0
41
41
  Requires-Dist: Pillow >=10.2.0
42
- Requires-Dist: pycitysim >=1.8.0
42
+ Requires-Dist: pycitysim >=1.12.2
43
43
  Requires-Dist: citystreetview >=1.1.0
44
44
  Requires-Dist: PyYAML >=6.0.1
45
45
  Requires-Dist: Requests >=2.31.0
@@ -60,7 +60,7 @@ Requires-Dist: transitions >=0.9.0
60
60
  - ![framwork](./static/framework.png)
61
61
 
62
62
  ### Workflow of CityAgent
63
- - ![workflow](./static/workflow.png)
63
+ - ![workflow](./static/workflow_1.png)
64
64
 
65
65
  ## Hands On - By An Easy Demo
66
66
  ### Apply for your App
@@ -92,10 +92,12 @@ citysim_request:
92
92
  map_request:
93
93
  mongo_coll: map_beijing_extend_20240205
94
94
  cache_dir: ./cache
95
+ route_request:
96
+ server: http://api-opencity-2x.fiblab.net:58082
95
97
  streetview_request:
96
98
  engine: baidumap / googlemap
97
- mapAK: your baidumap AK (if baidumap)
98
- proxy: your googlemap proxy (if googlemap, optional)
99
+ mapAK: baidumap api-key (if you use baidumap engine)
100
+ proxy: googlemap proxy (if you use googlemap engine)
99
101
 
100
102
  apphub_request:
101
103
  hub_url: https://api-opencity-2x.fiblab.net:58080
@@ -106,31 +108,56 @@ apphub_request:
106
108
  - Forget about **citysim_request**, let's focus on the other two.
107
109
 
108
110
  #### LLM_REQUEST
109
- - As you can tell, the whole CityAgent is based on the LLM, by now, there are three different parts of config items: **text_request**, **img_understand_request** and **img_generate_request**
111
+ - As you can see, the whole CityAgent is based on the LLM, by now, there are three different parts of config items: **text_request**, **img_understand_request** and **img_generate_request**
110
112
  - By now, we support [**qwen**](https://tongyi.aliyun.com/) and [**openai**](https://openai.com/)
111
113
  - `Notice: Our environments are basically conducted with qwen. If you prefer to use openai, then you may encounter hardships. AND fell free to issue us.`
112
114
  - Get your **api_key** and chooce your **model**s
113
115
 
114
- ### CITYSIM_REQUEST
115
- - There are no need to change the 'simulator' and 'map_request' config
116
- - 'streetview_request': this is the config used for streetview
117
- - By now, we support 'baidumap' and 'googlemap'
118
- - If you use 'baidumap', then you need to apply for a mapAK
119
- - If you use 'googlemap', then you can config your own proxy by 'proxy' attribute
116
+ #### CITYSIM_REQUEST
117
+ - Most of the configuration options in this part are determined, such as **simulator.server**, **map_request.mongo_coll**, **route_request.server**
118
+ - **map_request.cache_dir**: used for storing map data your machine, you can justify the target dir as you wish (**create the dir first**)
119
+ - **streetview_request**: used for obtaining streetview images, by now, we support baidumap engine and googlemap engine
120
+ - if you choose baidumap engine, you need to get a baidumap api-key
121
+ ``` yaml
122
+ streetview_request:
123
+ engine: baidumap
124
+ mapAK: xxxx
125
+ ```
126
+ - if you choose googlemap engine, you need to provide your proxy address, for example:
127
+ ``` yaml
128
+ streetview_request:
129
+ engine: googlemap
130
+ proxy:
131
+ http: http://xxxx
132
+ https: https://xxxx
133
+ ```
120
134
 
121
135
  #### APPHUB_REQUEST
122
- - This is basically used to connect with the backend.
136
+ - Used for creating the connection between backend server and client.
123
137
  - Put your **app_id** and **app_secret** here.
138
+ - Create your account and apply in [Opencity website](https://opencity.fiblab.net/)
124
139
 
125
140
  ### Installation
126
- - Install from **pip** easily.
127
- ```shell
128
- pip install pycityagent
129
- ```
141
+ #### PyPI Installation
142
+ - Install from **pip** easily.
143
+ ```shell
144
+ pip install pycityagent
145
+ ```
146
+
147
+ #### Install from source code
148
+ - Clone this repo
149
+ - Install required packages
150
+ ``` shell
151
+ pip install -r requirements.txt
152
+ ```
153
+ - Install **libGL.so.1**, if you ara using Linux with a suitable package manager: (apt for instance)
154
+ ``` shell
155
+ apt-get install libgl1
156
+ ```
130
157
 
131
158
  ### CODE and RUN
132
159
  - Check the **example** folder and copy files from it (`Remember replace the config file`)
133
- - Look at the Demo:
160
+ - Look at the Demo: (A citizen Agent demo)
134
161
  ```python
135
162
  import yaml
136
163
  from pycityagent.simulator import Simulator
@@ -147,7 +174,7 @@ async def main():
147
174
  smi = Simulator(config['citysim_request'])
148
175
 
149
176
  # get the person by person_id, return agent
150
- agent = await smi.GetAgent("name_of_agent", 8)
177
+ agent = await smi.GetCitizenAgent("name_of_agent", 8)
151
178
 
152
179
  # Help you build unique agent by scratch/profile
153
180
  agent.Image.load_scratch('scratch_template.json')
@@ -158,6 +185,7 @@ async def main():
158
185
 
159
186
  # Connect to apphub so you can interact with your agent in front end
160
187
  agent.ConnectToHub(config['apphub_request'])
188
+ agent.Bind()
161
189
 
162
190
  # Creat the soul (a LLM processor actually)
163
191
  llmConfig = LLMConfig(config['llm_request'])
@@ -0,0 +1,58 @@
1
+ pycityagent/__init__.py,sha256=UWAMvcctp49-8QaRHr2wuR4mLPNvUQ9ocQaXPVLHonI,186
2
+ pycityagent/agent.py,sha256=FxbQiP1IDhuBQuUI8IQeY8eFbr18NQxCiBefWICGnQc,8165
3
+ pycityagent/agent_citizen.py,sha256=AnU9LTP1vGccO7MIxcCYwT40S5Wd9XexO77xjb_oNDc,4972
4
+ pycityagent/agent_func.py,sha256=_9-68KECa0yi867XsXECT8goAw6VogPtb6ba4lNmHJY,4212
5
+ pycityagent/simulator.py,sha256=pX8jTxXl7w6WA4nliJFht74tY-dhOl8dvRvX0U5G00Y,5200
6
+ pycityagent/ac/__init__.py,sha256=ya2NEJ_GagbNc52uFkmPjTGm9FoFy5pRrhXlm0SCt3s,330
7
+ pycityagent/ac/ac.py,sha256=hln8_Dv05tBLcSXd2yso09Z5hsZkvqYBxk6o-sZKia8,2229
8
+ pycityagent/ac/action.py,sha256=MoJ-czSY8AIPDxUzD8-rLrbZIcomovmHvEkMLCTNOTw,1954
9
+ pycityagent/ac/action_stream.py,sha256=cUqLWBVbluIhuvTVi6kh2GWXuE1tHERRRa29OtvMchA,783
10
+ pycityagent/ac/controled.py,sha256=Q9wLPK0HgUO6w551c6gZNPNwtZMWojG3867m7Oy0cVM,539
11
+ pycityagent/ac/converse.py,sha256=IotnC3kwCcCk8-oOuIJOeYBPCVR9lItjci18TX1GGR0,1252
12
+ pycityagent/ac/hub_actions.py,sha256=iMyGjG5ul2whGllOfGJArvMYAXDCCy4pVmZB4HIWuHU,3226
13
+ pycityagent/ac/idle.py,sha256=TU67IWSN_DM1aCdMf6xkXX5uSTPgFIUCVwvxAxN03e0,504
14
+ pycityagent/ac/shop.py,sha256=i9nReY47wgVOMcmi_wp0W9M_dNoXmHpyEo93mC1K6ok,4095
15
+ pycityagent/ac/sim_actions.py,sha256=dpOnhwwsbdYmNGhTWMHzj38qrZd_h99zJraFj6vkljg,3845
16
+ pycityagent/ac/trip.py,sha256=AGdSgqw5CVFVyu_DPnaOY-fK6fTZsOCiA9aVUIAS9VU,1527
17
+ pycityagent/ac/citizen_actions/controled.py,sha256=co0YG7QMMpX-tpbbW_MasoPGm4RzDxkj3IkXFnsuxss,718
18
+ pycityagent/ac/citizen_actions/converse.py,sha256=ocMFvw-_sOUJmucgQjI87NNTZT9dj9svloiiU2zWDBE,1431
19
+ pycityagent/ac/citizen_actions/idle.py,sha256=zrKx8k6-YyT-4i-ZE8BuhsOJIJmCYGEO1WpUaPxWVWw,683
20
+ pycityagent/ac/citizen_actions/shop.py,sha256=lhrVelTVWF_9oAENStcX2YBgz6-fQaK3hL1OL9cl8uY,4273
21
+ pycityagent/ac/citizen_actions/trip.py,sha256=n_XiKqfYlexoxS4q-tMjf2LhIw9xyUFiQI5vSZjsUrw,1772
22
+ pycityagent/brain/__init__.py,sha256=lTW3TBpCTnuJaTWcaeb6j5QQChGBgmWvmSWOBeZp_AQ,373
23
+ pycityagent/brain/brain.py,sha256=WlIcp79ZbiWL47ubdVeXtUvQmzb0Rzluwq3tT2LjHBo,1067
24
+ pycityagent/brain/brainfc.py,sha256=XoiNUQgP4P7ui9dRZWTfzyzBVTDYZf10XqM7kot0Dbg,252
25
+ pycityagent/brain/memory.py,sha256=MhTO8qzhogi-vA12eN3Y3H8gdflYf01XQmIM92N-RaI,21934
26
+ pycityagent/brain/scheduler.py,sha256=56T78XrIdZb7qdlKPkNB-ibKH36ooEqHyHcp2jlID90,18492
27
+ pycityagent/brain/sence.py,sha256=taHdFT1o6ckK36WLOkyFMdRh72EJHkeBtb90cL4S6Mw,28683
28
+ pycityagent/brain/static.py,sha256=vvPaJGKqTBqNe_N3LTFdDjgjjdeZb5niFrYUhGBsGD4,29081
29
+ pycityagent/brain/persistence/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
+ pycityagent/brain/persistence/social.py,sha256=6hJi14sFm4LOU1JlnX8Vq_jFv7VII1uHDM9lrt7-JDA,27
31
+ pycityagent/brain/persistence/spatial.py,sha256=KShHehHOpvUnqxr12Y1FJF4RgyPjD3QNlWw136-zGR0,549
32
+ pycityagent/brain/reason/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
+ pycityagent/brain/reason/shop.py,sha256=jd0p6MDCNTPxo5j8glopiB501l8AuGP1vFlfDcxX69A,777
34
+ pycityagent/brain/reason/social.py,sha256=6QceFlzrA8FNwKzEvVS2aivSr12rkMbyOFO4mlACCfk,6493
35
+ pycityagent/brain/reason/trip.py,sha256=Slop2IxwZ9KE8ZqMOfYbMAgZ2hUcs4LuesxecoSliPc,1543
36
+ pycityagent/brain/reason/user.py,sha256=m1CQrG_Y-guB0WNeF1pR1HmzyPVrX4qAnuMIRl9-5ig,6412
37
+ pycityagent/brain/retrive/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
+ pycityagent/brain/retrive/social.py,sha256=EfF_9VCPTnDHBd2c5OmH3L4--07Ctps5HJBpSO3hUAA,135
39
+ pycityagent/cc/__init__.py,sha256=rE3JxxIB36tfYVUbtX9ZZ-TKL2lUhbiOJC1PsWqpIOI,148
40
+ pycityagent/cc/cc.py,sha256=p96ZzNKb6KxUNqPWEi1B7Rf0374oM5nJPwGWdaBYZ6k,4135
41
+ pycityagent/cc/conve.py,sha256=sRhZleIGeAV2m6mWoevwUMx2wD0xLVF5qnCld6pDC2E,150
42
+ pycityagent/cc/idle.py,sha256=RbqwG4BdSpLdZ-_13mLMbUs20q8r5drKB4wNIGWPOZw,474
43
+ pycityagent/cc/shop.py,sha256=9c8XTcUZBV90N_0MF3Gi9jlUS0LqNR3vIazEkK8tA28,149
44
+ pycityagent/cc/trip.py,sha256=ayTUnED7Kq6qiwEfCO_u-Hz6rRFNzBI25dZGUSV5dJY,312
45
+ pycityagent/cc/user.py,sha256=nS9NFfZypvXf-vLzqnYzLc6ek-CS8WALtEb00s1nREI,285
46
+ pycityagent/hubconnector/__init__.py,sha256=O11GJiILTibDUgJiAZxfIZ0kckKvToPUYijd06RQ0iQ,53
47
+ pycityagent/hubconnector/hubconnector.py,sha256=Mbaz9y13O_ZT1dlU5Y-fEuTCaVznzc000ECnqnUxkho,4879
48
+ pycityagent/image/__init__.py,sha256=PIKazmxiXLVbSwXIvau3zAvpynyDgukOdNKzh3Iy5ww,78
49
+ pycityagent/image/image.py,sha256=KyOBoX8I1KSi82lBCBku-NXgXX4gIFHi2cGEe7yQ-lI,5396
50
+ pycityagent/st/__init__.py,sha256=YzsQXrgqRvmoQ4dWqAztAriKd8wvnQVe0FOpX_oZmiY,109
51
+ pycityagent/st/st.py,sha256=z6yDo7ADOjostLg0mLmQ0oa_VysaCXFm4MnzC2H9nsI,5154
52
+ pycityagent/urbanllm/__init__.py,sha256=D24mYFXdIEL2vbvB7Cp_BGgJvg-tvEnCgtEAAGaqGDY,56
53
+ pycityagent/urbanllm/urbanllm.py,sha256=6PHRNSlYHrbHyzC_Pv2An71S7hkm-6XmAN7pJTozwas,4344
54
+ pycityagent-1.1.1.dist-info/LICENSE,sha256=Yo9QmwLDFU3VoOc0W8aYSCa5Yj5sJyqM3FEcbC2jMQQ,1063
55
+ pycityagent-1.1.1.dist-info/METADATA,sha256=mauUBRmAFcENHHhwi8FZ7f8n03ZnZAtdfk8M88YmGiE,7460
56
+ pycityagent-1.1.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
57
+ pycityagent-1.1.1.dist-info/top_level.txt,sha256=mf70CsOn3eVJBwHQ_TjCesoc-elD0Bj2WLsi5APRjlU,12
58
+ pycityagent-1.1.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,48 +0,0 @@
1
- pycityagent/__init__.py,sha256=AUksztmIqz0WYM9wNuO0WYZCNygPuhnQsRiqDmG3nTA,87
2
- pycityagent/agent.py,sha256=B_AK49HvdqbTiyvPZ3MRq8XID3qjhkjsywsJ-fNWB6Y,9637
3
- pycityagent/simulator.py,sha256=PbkgpeE6rwLxXSdEsGd60cc0kzw1zrgv9sifug9zHEU,5542
4
- pycityagent/ac/__init__.py,sha256=vzDpFox7x96yhhwUro7dWQvv1ztUzNjlnYovLSTV0lQ,141
5
- pycityagent/ac/ac.py,sha256=l7aas0w4UmSCXoXcSzp7md73zk9aRTxYK0Ev6ep7zMI,1574
6
- pycityagent/ac/action.py,sha256=MxdDo0BS_dZZgvNTmYK6SSV4oLn0OVdciEb5nBMtMrg,324
7
- pycityagent/ac/controled.py,sha256=Q9wLPK0HgUO6w551c6gZNPNwtZMWojG3867m7Oy0cVM,539
8
- pycityagent/ac/converse.py,sha256=IotnC3kwCcCk8-oOuIJOeYBPCVR9lItjci18TX1GGR0,1252
9
- pycityagent/ac/idle.py,sha256=TU67IWSN_DM1aCdMf6xkXX5uSTPgFIUCVwvxAxN03e0,504
10
- pycityagent/ac/shop.py,sha256=i9nReY47wgVOMcmi_wp0W9M_dNoXmHpyEo93mC1K6ok,4095
11
- pycityagent/ac/trip.py,sha256=AGdSgqw5CVFVyu_DPnaOY-fK6fTZsOCiA9aVUIAS9VU,1527
12
- pycityagent/brain/__init__.py,sha256=3uAqrqRQE6mmhFzcTRygE-J5IxZz6tIWyF4WL1M3iSg,348
13
- pycityagent/brain/brain.py,sha256=WlIcp79ZbiWL47ubdVeXtUvQmzb0Rzluwq3tT2LjHBo,1067
14
- pycityagent/brain/brainfc.py,sha256=XoiNUQgP4P7ui9dRZWTfzyzBVTDYZf10XqM7kot0Dbg,252
15
- pycityagent/brain/memory.py,sha256=7qubt5kmn9lzFD75OwmePhtLXsO_HGYhxlRbbTfJtBY,19125
16
- pycityagent/brain/scheduler.py,sha256=56T78XrIdZb7qdlKPkNB-ibKH36ooEqHyHcp2jlID90,18492
17
- pycityagent/brain/sence.py,sha256=TX6t4zn_c8Diwo8UlCmaZ7U4OH4RAmzpZERrTYtcIqA,13715
18
- pycityagent/brain/static.py,sha256=vvPaJGKqTBqNe_N3LTFdDjgjjdeZb5niFrYUhGBsGD4,29081
19
- pycityagent/brain/persistence/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
- pycityagent/brain/persistence/social.py,sha256=6hJi14sFm4LOU1JlnX8Vq_jFv7VII1uHDM9lrt7-JDA,27
21
- pycityagent/brain/persistence/spatial.py,sha256=KShHehHOpvUnqxr12Y1FJF4RgyPjD3QNlWw136-zGR0,549
22
- pycityagent/brain/reason/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
- pycityagent/brain/reason/shop.py,sha256=jd0p6MDCNTPxo5j8glopiB501l8AuGP1vFlfDcxX69A,777
24
- pycityagent/brain/reason/social.py,sha256=6QceFlzrA8FNwKzEvVS2aivSr12rkMbyOFO4mlACCfk,6493
25
- pycityagent/brain/reason/trip.py,sha256=Slop2IxwZ9KE8ZqMOfYbMAgZ2hUcs4LuesxecoSliPc,1543
26
- pycityagent/brain/reason/user.py,sha256=m1CQrG_Y-guB0WNeF1pR1HmzyPVrX4qAnuMIRl9-5ig,6412
27
- pycityagent/brain/retrive/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
- pycityagent/brain/retrive/social.py,sha256=EfF_9VCPTnDHBd2c5OmH3L4--07Ctps5HJBpSO3hUAA,135
29
- pycityagent/cc/__init__.py,sha256=eNYRAjU_IIJY1Nt2vGyt34KQjbrpyZuv_AvY_iuPb6A,123
30
- pycityagent/cc/cc.py,sha256=b2_Q4dpPO8F1tY-N1m-YFfdzEu_dg8AYsjihvhrWijM,4201
31
- pycityagent/cc/conve.py,sha256=sRhZleIGeAV2m6mWoevwUMx2wD0xLVF5qnCld6pDC2E,150
32
- pycityagent/cc/idle.py,sha256=RbqwG4BdSpLdZ-_13mLMbUs20q8r5drKB4wNIGWPOZw,474
33
- pycityagent/cc/shop.py,sha256=9c8XTcUZBV90N_0MF3Gi9jlUS0LqNR3vIazEkK8tA28,149
34
- pycityagent/cc/trip.py,sha256=ayTUnED7Kq6qiwEfCO_u-Hz6rRFNzBI25dZGUSV5dJY,312
35
- pycityagent/cc/user.py,sha256=nS9NFfZypvXf-vLzqnYzLc6ek-CS8WALtEb00s1nREI,285
36
- pycityagent/hubconnector/__init__.py,sha256=O11GJiILTibDUgJiAZxfIZ0kckKvToPUYijd06RQ0iQ,53
37
- pycityagent/hubconnector/hubconnector.py,sha256=U8sN9_XX0UVuKaKW57_rmst87XjGlCy79Ar5LQQOnJ4,5259
38
- pycityagent/image/__init__.py,sha256=OiSQBalg4Uo8bjjLNaUWb_DjSb-Rg8yGfb8Su6Sdvo4,58
39
- pycityagent/image/image.py,sha256=0efdbmQCGwqPb2WmBcRIjDu0miTSOPEkOGUKyZaDg58,5225
40
- pycityagent/st/__init__.py,sha256=YzsQXrgqRvmoQ4dWqAztAriKd8wvnQVe0FOpX_oZmiY,109
41
- pycityagent/st/st.py,sha256=bGisgrBaKEQCUMobRcBqIPh_4N5I0GIVc1mGglSwBO8,3743
42
- pycityagent/urbanllm/__init__.py,sha256=D24mYFXdIEL2vbvB7Cp_BGgJvg-tvEnCgtEAAGaqGDY,56
43
- pycityagent/urbanllm/urbanllm.py,sha256=XEmU4fpdxA7zZlSfdXnXd9SIsPF0eC1SjxPKHAjxuAE,4341
44
- pycityagent-1.0.0.dist-info/LICENSE,sha256=Yo9QmwLDFU3VoOc0W8aYSCa5Yj5sJyqM3FEcbC2jMQQ,1063
45
- pycityagent-1.0.0.dist-info/METADATA,sha256=jWCBLBIrjSOqPSIouNDA__kUnLfIwRd4JfwXeBgHMKU,6460
46
- pycityagent-1.0.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
47
- pycityagent-1.0.0.dist-info/top_level.txt,sha256=mf70CsOn3eVJBwHQ_TjCesoc-elD0Bj2WLsi5APRjlU,12
48
- pycityagent-1.0.0.dist-info/RECORD,,