pycityagent 1.1.2__py3-none-any.whl → 1.1.4__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相关
@@ -19,6 +19,8 @@ class LLMConfig:
19
19
  ) -> None:
20
20
  self.config = config
21
21
  self.text = config['text_request']
22
+ if 'api_base' in self.text.keys() and self.text['api_base'] == 'None':
23
+ self.text['api_base'] = None
22
24
  self.image_u = config['img_understand_request']
23
25
  self.image_g = config['img_generate_request']
24
26
 
@@ -41,12 +43,14 @@ class UrbanLLM:
41
43
  Returns:
42
44
  - (str): the response content
43
45
  """
44
- client = None if self.config.text['http_client'] == None else self.config.text['http_client']
46
+ if 'api_base' in self.config.text.keys():
47
+ api_base = self.config.text['api_base']
48
+ else:
49
+ api_base = None
45
50
  if self.config.text['request_type'] == 'openai':
46
51
  client = OpenAI(
47
52
  api_key=self.config.text['api_key'],
48
- base_url=self.config.text['api_base'],
49
- http_client=client
53
+ base_url=api_base,
50
54
  )
51
55
  response = client.chat.completions.create(
52
56
  model=self.config.text['model'],
@@ -75,7 +79,7 @@ class UrbanLLM:
75
79
  Image understanding
76
80
 
77
81
  Args:
78
- - img_path: 图像的绝对路径. The absolute path of selected Image
82
+ - img_path: 目标图像的路径. The path of selected Image
79
83
  - prompt: 理解提示词 - 例如理解方向. The understanding prompts
80
84
 
81
85
  Returns:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycityagent
3
- Version: 1.1.2
3
+ Version: 1.1.4
4
4
  Summary: LLM-based城市模拟器agent构建库
5
5
  Author-email: Yuwei Yan <pinkgranite86@gmail.com>
6
6
  License: MIT License
@@ -77,7 +77,7 @@ llm_request:
77
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
+ (api_base): xxx (this is an optional config, if you use opanai and want to use your own backend LLM model, default to "https://api.openai.com/v1")
81
81
  img_understand_request:
82
82
  request_type: qwen
83
83
  api_key: xxx
@@ -113,7 +113,8 @@ apphub_request:
113
113
  - By now, we support [**qwen**](https://tongyi.aliyun.com/) and [**openai**](https://openai.com/)
114
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.`
115
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**)
116
+ - If you want to use your backend models, set the **api_base** (only available when using **openai**)
117
+ - default value: "https://api.openai.com/v1"
117
118
 
118
119
  #### CITYSIM_REQUEST
119
120
  - 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=okwHKRg-tuFBizkeH6dbF2KPH5Y-hC6Aufn2fX10-t0,4481
54
- pycityagent-1.1.2.dist-info/LICENSE,sha256=Yo9QmwLDFU3VoOc0W8aYSCa5Yj5sJyqM3FEcbC2jMQQ,1063
55
- pycityagent-1.1.2.dist-info/METADATA,sha256=ab6Q31q_aOubjg-tlL7VlH0mucU63w6aqER08dJ0vNU,7657
56
- pycityagent-1.1.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
57
- pycityagent-1.1.2.dist-info/top_level.txt,sha256=mf70CsOn3eVJBwHQ_TjCesoc-elD0Bj2WLsi5APRjlU,12
58
- pycityagent-1.1.2.dist-info/RECORD,,
53
+ pycityagent/urbanllm/urbanllm.py,sha256=7Dc71zGHvvPj1pV76ZzIMPheTVzmsoaL-fw0uc3RJb0,4579
54
+ pycityagent-1.1.4.dist-info/LICENSE,sha256=Yo9QmwLDFU3VoOc0W8aYSCa5Yj5sJyqM3FEcbC2jMQQ,1063
55
+ pycityagent-1.1.4.dist-info/METADATA,sha256=18S7XJjHvyBnTUtlK0KmAEZld1dgidg1jpAbe339Atg,7768
56
+ pycityagent-1.1.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
57
+ pycityagent-1.1.4.dist-info/top_level.txt,sha256=mf70CsOn3eVJBwHQ_TjCesoc-elD0Bj2WLsi5APRjlU,12
58
+ pycityagent-1.1.4.dist-info/RECORD,,