pycityagent 2.0.0a93__cp311-cp311-macosx_11_0_arm64.whl → 2.0.0a94__cp311-cp311-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.
- pycityagent/llm/llm.py +9 -2
- {pycityagent-2.0.0a93.dist-info → pycityagent-2.0.0a94.dist-info}/METADATA +1 -1
- {pycityagent-2.0.0a93.dist-info → pycityagent-2.0.0a94.dist-info}/RECORD +7 -7
- {pycityagent-2.0.0a93.dist-info → pycityagent-2.0.0a94.dist-info}/LICENSE +0 -0
- {pycityagent-2.0.0a93.dist-info → pycityagent-2.0.0a94.dist-info}/WHEEL +0 -0
- {pycityagent-2.0.0a93.dist-info → pycityagent-2.0.0a94.dist-info}/entry_points.txt +0 -0
- {pycityagent-2.0.0a93.dist-info → pycityagent-2.0.0a94.dist-info}/top_level.txt +0 -0
pycityagent/llm/llm.py
CHANGED
@@ -44,12 +44,12 @@ class LLM:
|
|
44
44
|
- `config`: An instance of `LLMConfig` containing configuration settings for the LLM.
|
45
45
|
"""
|
46
46
|
self.config = config
|
47
|
-
if config.text["request_type"] not in ["openai", "deepseek", "qwen", "zhipuai"]:
|
47
|
+
if config.text["request_type"] not in ["openai", "deepseek", "qwen", "zhipuai", "siliconflow"]:
|
48
48
|
raise ValueError("Invalid request type for text request")
|
49
49
|
self.prompt_tokens_used = 0
|
50
50
|
self.completion_tokens_used = 0
|
51
51
|
self.request_number = 0
|
52
|
-
self.semaphore =
|
52
|
+
self.semaphore = asyncio.Semaphore(200)
|
53
53
|
self._current_client_index = 0
|
54
54
|
self._log_list = []
|
55
55
|
|
@@ -75,6 +75,12 @@ class LLM:
|
|
75
75
|
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
|
76
76
|
timeout=300,
|
77
77
|
)
|
78
|
+
elif self.config.text["request_type"] == "siliconflow":
|
79
|
+
client = AsyncOpenAI(
|
80
|
+
api_key=api_key,
|
81
|
+
base_url="https://api.siliconflow.cn/v1",
|
82
|
+
timeout=300,
|
83
|
+
)
|
78
84
|
elif self.config.text["request_type"] == "zhipuai":
|
79
85
|
client = ZhipuAI(api_key=api_key, timeout=300)
|
80
86
|
else:
|
@@ -237,6 +243,7 @@ class LLM:
|
|
237
243
|
self.config.text["request_type"] == "openai"
|
238
244
|
or self.config.text["request_type"] == "deepseek"
|
239
245
|
or self.config.text["request_type"] == "qwen"
|
246
|
+
or self.config.text["request_type"] == "siliconflow"
|
240
247
|
):
|
241
248
|
for attempt in range(retries):
|
242
249
|
try:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: pycityagent
|
3
|
-
Version: 2.0.
|
3
|
+
Version: 2.0.0a94
|
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
|
@@ -9,7 +9,7 @@ pycityagent/tools/__init__.py,sha256=y7sMVMHf0AbivlczM2h-kr7mkgXK-WAx3S9BXLXkWvw
|
|
9
9
|
pycityagent/tools/tool.py,sha256=4ZJSHbNM8dfAVwZEw8T0a2_9OuPsPQpKSVL4WxZVBUc,9022
|
10
10
|
pycityagent/llm/llmconfig.py,sha256=6AqCMV4B_JqBD2mb98bLGzpUdlOCnziQKae-Hhxxp-E,469
|
11
11
|
pycityagent/llm/__init__.py,sha256=iWs6FLgrbRVIiqOf4ILS89gkVCTvS7HFC3vG-MWuyko,205
|
12
|
-
pycityagent/llm/llm.py,sha256=
|
12
|
+
pycityagent/llm/llm.py,sha256=FgtRxpp53scmUH9i7XwaTXZ-bayw-bAanXzlRZuY6wY,20406
|
13
13
|
pycityagent/llm/embeddings.py,sha256=3610I-_scAy8HwRNpT8hVJpH9_8_pTLCPptqnzSq10o,11322
|
14
14
|
pycityagent/llm/utils.py,sha256=rSx_fp-_Gh0vZ-x2rqAUqnpS56BVTZ4ChfAMarB8S1A,195
|
15
15
|
pycityagent/memory/memory.py,sha256=5mUweo-BgQYbXmVRAk7HTUXsar6O6iYz79VbLuMAvjo,45063
|
@@ -89,9 +89,9 @@ pycityagent/cityagent/blocks/mobility_block.py,sha256=OZoA-swFdX0Ezpzkyp8jJMNPQ5
|
|
89
89
|
pycityagent/survey/models.py,sha256=g3xni4GcA1Py3vlGt6z4ltutjgQ4G0uINYAM8vKRJAw,5225
|
90
90
|
pycityagent/survey/__init__.py,sha256=rxwou8U9KeFSP7rMzXtmtp2fVFZxK4Trzi-psx9LPIs,153
|
91
91
|
pycityagent/survey/manager.py,sha256=tHkdeq4lTfAHwvgf4-udsXri0z2l6E00rEbvwl7SqRs,3439
|
92
|
-
pycityagent-2.0.
|
93
|
-
pycityagent-2.0.
|
94
|
-
pycityagent-2.0.
|
95
|
-
pycityagent-2.0.
|
96
|
-
pycityagent-2.0.
|
97
|
-
pycityagent-2.0.
|
92
|
+
pycityagent-2.0.0a94.dist-info/RECORD,,
|
93
|
+
pycityagent-2.0.0a94.dist-info/LICENSE,sha256=n2HPXiupinpyHMnIkbCf3OTYd3KMqbmldu1e7av0CAU,1084
|
94
|
+
pycityagent-2.0.0a94.dist-info/WHEEL,sha256=NW1RskY9zow1Y68W-gXg0oZyBRAugI1JHywIzAIai5o,109
|
95
|
+
pycityagent-2.0.0a94.dist-info/entry_points.txt,sha256=BZcne49AAIFv-hawxGnPbblea7X3MtAtoPyDX8L4OC4,132
|
96
|
+
pycityagent-2.0.0a94.dist-info/top_level.txt,sha256=yOmeu6cSXmiUtScu53a3s0p7BGtLMaV0aff83EHCTic,43
|
97
|
+
pycityagent-2.0.0a94.dist-info/METADATA,sha256=oHBYTha8EtA0rjMUS4UN4_pYb9BkkoVP4ZYX75t9DgQ,9110
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|