pycityagent 1.1.1__py3-none-any.whl → 1.1.3__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.
pycityagent/simulator.py CHANGED
@@ -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**
@@ -2,7 +2,7 @@ pycityagent/__init__.py,sha256=UWAMvcctp49-8QaRHr2wuR4mLPNvUQ9ocQaXPVLHonI,186
2
2
  pycityagent/agent.py,sha256=FxbQiP1IDhuBQuUI8IQeY8eFbr18NQxCiBefWICGnQc,8165
3
3
  pycityagent/agent_citizen.py,sha256=AnU9LTP1vGccO7MIxcCYwT40S5Wd9XexO77xjb_oNDc,4972
4
4
  pycityagent/agent_func.py,sha256=_9-68KECa0yi867XsXECT8goAw6VogPtb6ba4lNmHJY,4212
5
- pycityagent/simulator.py,sha256=pX8jTxXl7w6WA4nliJFht74tY-dhOl8dvRvX0U5G00Y,5200
5
+ pycityagent/simulator.py,sha256=f8IATajGMuUHaHQV_152tFQQAMv2aVWbusrVpjx3LZI,5194
6
6
  pycityagent/ac/__init__.py,sha256=ya2NEJ_GagbNc52uFkmPjTGm9FoFy5pRrhXlm0SCt3s,330
7
7
  pycityagent/ac/ac.py,sha256=hln8_Dv05tBLcSXd2yso09Z5hsZkvqYBxk6o-sZKia8,2229
8
8
  pycityagent/ac/action.py,sha256=MoJ-czSY8AIPDxUzD8-rLrbZIcomovmHvEkMLCTNOTw,1954
@@ -50,9 +50,9 @@ pycityagent/image/image.py,sha256=KyOBoX8I1KSi82lBCBku-NXgXX4gIFHi2cGEe7yQ-lI,53
50
50
  pycityagent/st/__init__.py,sha256=YzsQXrgqRvmoQ4dWqAztAriKd8wvnQVe0FOpX_oZmiY,109
51
51
  pycityagent/st/st.py,sha256=z6yDo7ADOjostLg0mLmQ0oa_VysaCXFm4MnzC2H9nsI,5154
52
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,,
53
+ pycityagent/urbanllm/urbanllm.py,sha256=okwHKRg-tuFBizkeH6dbF2KPH5Y-hC6Aufn2fX10-t0,4481
54
+ pycityagent-1.1.3.dist-info/LICENSE,sha256=Yo9QmwLDFU3VoOc0W8aYSCa5Yj5sJyqM3FEcbC2jMQQ,1063
55
+ pycityagent-1.1.3.dist-info/METADATA,sha256=w22vYIDhb2ND3fulYuuwBpxDvwalqrlQP8-ceFwQrVg,7657
56
+ pycityagent-1.1.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
57
+ pycityagent-1.1.3.dist-info/top_level.txt,sha256=mf70CsOn3eVJBwHQ_TjCesoc-elD0Bj2WLsi5APRjlU,12
58
+ pycityagent-1.1.3.dist-info/RECORD,,