pycityagent 1.1.1__tar.gz → 1.1.3__tar.gz

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.
Files changed (63) hide show
  1. {pycityagent-1.1.1 → pycityagent-1.1.3}/PKG-INFO +5 -3
  2. {pycityagent-1.1.1 → pycityagent-1.1.3}/README.md +4 -2
  3. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/simulator.py +1 -1
  4. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/urbanllm/urbanllm.py +3 -2
  5. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent.egg-info/PKG-INFO +5 -3
  6. {pycityagent-1.1.1 → pycityagent-1.1.3}/LICENSE +0 -0
  7. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/__init__.py +0 -0
  8. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/ac/__init__.py +0 -0
  9. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/ac/ac.py +0 -0
  10. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/ac/action.py +0 -0
  11. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/ac/action_stream.py +0 -0
  12. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/ac/citizen_actions/controled.py +0 -0
  13. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/ac/citizen_actions/converse.py +0 -0
  14. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/ac/citizen_actions/idle.py +0 -0
  15. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/ac/citizen_actions/shop.py +0 -0
  16. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/ac/citizen_actions/trip.py +0 -0
  17. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/ac/controled.py +0 -0
  18. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/ac/converse.py +0 -0
  19. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/ac/hub_actions.py +0 -0
  20. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/ac/idle.py +0 -0
  21. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/ac/shop.py +0 -0
  22. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/ac/sim_actions.py +0 -0
  23. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/ac/trip.py +0 -0
  24. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/agent.py +0 -0
  25. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/agent_citizen.py +0 -0
  26. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/agent_func.py +0 -0
  27. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/brain/__init__.py +0 -0
  28. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/brain/brain.py +0 -0
  29. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/brain/brainfc.py +0 -0
  30. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/brain/memory.py +0 -0
  31. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/brain/persistence/__init__.py +0 -0
  32. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/brain/persistence/social.py +0 -0
  33. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/brain/persistence/spatial.py +0 -0
  34. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/brain/reason/__init__.py +0 -0
  35. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/brain/reason/shop.py +0 -0
  36. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/brain/reason/social.py +0 -0
  37. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/brain/reason/trip.py +0 -0
  38. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/brain/reason/user.py +0 -0
  39. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/brain/retrive/__init__.py +0 -0
  40. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/brain/retrive/social.py +0 -0
  41. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/brain/scheduler.py +0 -0
  42. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/brain/sence.py +0 -0
  43. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/brain/static.py +0 -0
  44. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/cc/__init__.py +0 -0
  45. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/cc/cc.py +0 -0
  46. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/cc/conve.py +0 -0
  47. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/cc/idle.py +0 -0
  48. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/cc/shop.py +0 -0
  49. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/cc/trip.py +0 -0
  50. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/cc/user.py +0 -0
  51. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/hubconnector/__init__.py +0 -0
  52. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/hubconnector/hubconnector.py +0 -0
  53. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/image/__init__.py +0 -0
  54. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/image/image.py +0 -0
  55. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/st/__init__.py +0 -0
  56. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/st/st.py +0 -0
  57. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent/urbanllm/__init__.py +0 -0
  58. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent.egg-info/SOURCES.txt +0 -0
  59. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent.egg-info/dependency_links.txt +0 -0
  60. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent.egg-info/requires.txt +0 -0
  61. {pycityagent-1.1.1 → pycityagent-1.1.3}/pycityagent.egg-info/top_level.txt +0 -0
  62. {pycityagent-1.1.1 → pycityagent-1.1.3}/pyproject.toml +0 -0
  63. {pycityagent-1.1.1 → pycityagent-1.1.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycityagent
3
- Version: 1.1.1
3
+ Version: 1.1.3
4
4
  Summary: LLM-based城市模拟器agent构建库
5
5
  Author-email: Yuwei Yan <pinkgranite86@gmail.com>
6
6
  License: MIT License
@@ -74,9 +74,10 @@ Requires-Dist: transitions>=0.9.0
74
74
  ```yaml
75
75
  llm_request:
76
76
  text_request:
77
- request_type: qwen
77
+ request_type: openai / qwen
78
78
  api_key: xxx
79
79
  model: xxx
80
+ http_client: xxx (if you use opanai and want to use your own backend LLM model)
80
81
  img_understand_request:
81
82
  request_type: qwen
82
83
  api_key: xxx
@@ -111,7 +112,8 @@ apphub_request:
111
112
  - 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**
112
113
  - By now, we support [**qwen**](https://tongyi.aliyun.com/) and [**openai**](https://openai.com/)
113
114
  - `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.`
114
- - Get your **api_key** and chooce your **model**s
115
+ - Get your **api_key** and chooce your **model**
116
+ - If you want to use your backend models, set the **http_client** (only available when using **openai**)
115
117
 
116
118
  #### CITYSIM_REQUEST
117
119
  - Most of the configuration options in this part are determined, such as **simulator.server**, **map_request.mongo_coll**, **route_request.server**
@@ -27,9 +27,10 @@
27
27
  ```yaml
28
28
  llm_request:
29
29
  text_request:
30
- request_type: qwen
30
+ request_type: openai / qwen
31
31
  api_key: xxx
32
32
  model: xxx
33
+ http_client: xxx (if you use opanai and want to use your own backend LLM model)
33
34
  img_understand_request:
34
35
  request_type: qwen
35
36
  api_key: xxx
@@ -64,7 +65,8 @@ apphub_request:
64
65
  - 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**
65
66
  - By now, we support [**qwen**](https://tongyi.aliyun.com/) and [**openai**](https://openai.com/)
66
67
  - `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.`
67
- - Get your **api_key** and chooce your **model**s
68
+ - Get your **api_key** and chooce your **model**
69
+ - If you want to use your backend models, set the **http_client** (only available when using **openai**)
68
70
 
69
71
  #### CITYSIM_REQUEST
70
72
  - Most of the configuration options in this part are determined, such as **simulator.server**, **map_request.mongo_coll**, **route_request.server**
@@ -45,7 +45,7 @@ class Simulator:
45
45
  mongo_coll = config['map_request']['mongo_coll'],
46
46
  cache_dir = config['map_request']['cache_dir'],
47
47
  )
48
- self.routing = RoutingClient(self.config['route_request']['server'], True)
48
+ self.routing = RoutingClient(self.config['route_request']['server'])
49
49
  self.time = 0
50
50
 
51
51
  # * Agent相关
@@ -41,10 +41,12 @@ class UrbanLLM:
41
41
  Returns:
42
42
  - (str): the response content
43
43
  """
44
+ client = None if self.config.text['http_client'] == None else self.config.text['http_client']
44
45
  if self.config.text['request_type'] == 'openai':
45
46
  client = OpenAI(
46
47
  api_key=self.config.text['api_key'],
47
- base_url=self.config.text['api_base']
48
+ base_url=self.config.text['api_base'],
49
+ http_client=client
48
50
  )
49
51
  response = client.chat.completions.create(
50
52
  model=self.config.text['model'],
@@ -53,7 +55,6 @@ class UrbanLLM:
53
55
  )
54
56
  return response.choices[0].message.content
55
57
  elif self.config.text['request_type'] == 'qwen':
56
-
57
58
  response = dashscope.Generation.call(
58
59
  model=self.config.text['model'],
59
60
  api_key=self.config.text['api_key'],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycityagent
3
- Version: 1.1.1
3
+ Version: 1.1.3
4
4
  Summary: LLM-based城市模拟器agent构建库
5
5
  Author-email: Yuwei Yan <pinkgranite86@gmail.com>
6
6
  License: MIT License
@@ -74,9 +74,10 @@ Requires-Dist: transitions>=0.9.0
74
74
  ```yaml
75
75
  llm_request:
76
76
  text_request:
77
- request_type: qwen
77
+ request_type: openai / qwen
78
78
  api_key: xxx
79
79
  model: xxx
80
+ http_client: xxx (if you use opanai and want to use your own backend LLM model)
80
81
  img_understand_request:
81
82
  request_type: qwen
82
83
  api_key: xxx
@@ -111,7 +112,8 @@ apphub_request:
111
112
  - 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**
112
113
  - By now, we support [**qwen**](https://tongyi.aliyun.com/) and [**openai**](https://openai.com/)
113
114
  - `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.`
114
- - Get your **api_key** and chooce your **model**s
115
+ - Get your **api_key** and chooce your **model**
116
+ - If you want to use your backend models, set the **http_client** (only available when using **openai**)
115
117
 
116
118
  #### CITYSIM_REQUEST
117
119
  - Most of the configuration options in this part are determined, such as **simulator.server**, **map_request.mongo_coll**, **route_request.server**
File without changes
File without changes
File without changes