aiecs 1.3.5__py3-none-any.whl → 1.3.8__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.

Potentially problematic release.


This version of aiecs might be problematic. Click here for more details.

aiecs/__init__.py CHANGED
@@ -5,7 +5,7 @@ A powerful Python middleware framework for building AI-powered applications
5
5
  with tool orchestration, task execution, and multi-provider LLM support.
6
6
  """
7
7
 
8
- __version__ = "1.3.5"
8
+ __version__ = "1.3.8"
9
9
  __author__ = "AIECS Team"
10
10
  __email__ = "iretbl@gmail.com"
11
11
 
@@ -74,10 +74,55 @@ class RedisClient:
74
74
  client = await self.get_client()
75
75
  return await client.hgetall(name)
76
76
 
77
- async def hset(self, name: str, mapping: dict) -> int:
78
- """Set hash fields"""
77
+ async def hset(
78
+ self,
79
+ name: str,
80
+ key: Optional[str] = None,
81
+ value: Optional[str] = None,
82
+ mapping: Optional[dict] = None
83
+ ) -> int:
84
+ """Set hash fields
85
+
86
+ Supports two calling patterns:
87
+ 1. hset(name, key, value) - Set single field (positional)
88
+ 2. hset(name, key=key, value=value) - Set single field (keyword)
89
+ 3. hset(name, mapping={...}) - Set multiple fields
90
+
91
+ Args:
92
+ name: Redis hash key name
93
+ key: Field name (for single field set)
94
+ value: Field value (for single field set)
95
+ mapping: Dictionary of field-value pairs (for multiple fields)
96
+
97
+ Returns:
98
+ Number of fields that were added
99
+
100
+ Raises:
101
+ ValueError: If neither (key, value) nor mapping is provided
102
+
103
+ Examples:
104
+ # Single field with positional args
105
+ await redis_client.hset("myhash", "field1", "value1")
106
+
107
+ # Single field with keyword args
108
+ await redis_client.hset("myhash", key="field1", value="value1")
109
+
110
+ # Multiple fields with mapping
111
+ await redis_client.hset("myhash", mapping={"field1": "value1", "field2": "value2"})
112
+ """
79
113
  client = await self.get_client()
80
- return await client.hset(name, mapping=mapping)
114
+
115
+ if mapping is not None:
116
+ # Multiple fields mode
117
+ return await client.hset(name, mapping=mapping)
118
+ elif key is not None and value is not None:
119
+ # Single field mode
120
+ return await client.hset(name, key=key, value=value)
121
+ else:
122
+ raise ValueError(
123
+ "Either provide (key, value) or mapping parameter. "
124
+ f"Got: key={key}, value={value}, mapping={mapping}"
125
+ )
81
126
 
82
127
  async def expire(self, name: str, time: int) -> bool:
83
128
  """Set expiration time"""
@@ -170,11 +170,29 @@ class VertexAIClient(BaseLLMClient):
170
170
  fixed_count = 0
171
171
 
172
172
  for i, part in enumerate(text_parts):
173
+ # Check for thinking content that needs formatting
174
+ needs_thinking_format = False
175
+
173
176
  if '<thinking>' in part and '</thinking>' not in part:
174
- # Incomplete thinking tag: add closing tag
177
+ # Incomplete <thinking> tag: add closing tag
175
178
  part = part + '\n</thinking>'
176
- fixed_count += 1
179
+ needs_thinking_format = True
177
180
  self.logger.debug(f" Part {i+1}: Incomplete <thinking> tag fixed")
181
+ elif part.startswith('thinking') and '</thinking>' not in part:
182
+ # thinking\n format: convert to <thinking>...</thinking>
183
+ if part.startswith('thinking\n'):
184
+ # thinking\n格式:提取内容并包装
185
+ content = part[8:] # 跳过 "thinking\n"
186
+ else:
187
+ # thinking开头但无换行:提取内容并包装
188
+ content = part[7:] # 跳过 "thinking"
189
+
190
+ part = f"<thinking>\n{content}\n</thinking>"
191
+ needs_thinking_format = True
192
+ self.logger.debug(f" Part {i+1}: thinking\\n format converted to <thinking> tags")
193
+
194
+ if needs_thinking_format:
195
+ fixed_count += 1
178
196
 
179
197
  processed_parts.append(part)
180
198
 
aiecs/main.py CHANGED
@@ -142,7 +142,7 @@ async def lifespan(app: FastAPI):
142
142
  app = FastAPI(
143
143
  title="AIECS - AI Execute Services",
144
144
  description="Middleware service for AI-powered task execution and tool orchestration",
145
- version="1.3.5",
145
+ version="1.3.8",
146
146
  lifespan=lifespan
147
147
  )
148
148
 
@@ -167,7 +167,7 @@ async def health_check():
167
167
  return {
168
168
  "status": "healthy",
169
169
  "service": "aiecs",
170
- "version": "1.3.5"
170
+ "version": "1.3.8"
171
171
  }
172
172
 
173
173
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiecs
3
- Version: 1.3.5
3
+ Version: 1.3.8
4
4
  Summary: AI Execute Services - A middleware framework for AI-powered task execution and tool orchestration
5
5
  Author-email: AIECS Team <iretbl@gmail.com>
6
6
  License-Expression: MIT
@@ -1,7 +1,7 @@
1
- aiecs/__init__.py,sha256=0C3__5CeIMR8OU-fqcmKw2ETo4SIjYuFNk_MZNI_wfI,1859
1
+ aiecs/__init__.py,sha256=iF-mqJnpmlecw7m_TFxVkpdFxs2IpOq9H4NZrOngh3U,1859
2
2
  aiecs/__main__.py,sha256=AfQpzy3SgwWuP4DuymYcm4MISMuzqwhxxGSYo53PBvY,1035
3
3
  aiecs/aiecs_client.py,sha256=gIqecRBBH_bYIWhqiHCemdVgmGb9Jqdxf1b6RoqXWlQ,17276
4
- aiecs/main.py,sha256=jYY2nqk00XGoEtyQdLNkmpt-4RF52QeQyZUNU0305Ig,10837
4
+ aiecs/main.py,sha256=emllmgosKXpDsa5pxqeAMSOCSjIXdZxS6AsGQ9vxIqM,10837
5
5
  aiecs/application/__init__.py,sha256=NkmrUH1DqxJ3vaVC8QwscNdlWqHfC7ZagL4k3nZ_qz4,192
6
6
  aiecs/application/executors/__init__.py,sha256=WIl7L9HBsEhNfbNtJdvBvFUJXzESvNZVaiAA6tdtJcs,191
7
7
  aiecs/application/executors/operation_executor.py,sha256=-7mFo1hUnWdehVPg0fnSiRhW3LACpIiyLSH-iu7bX4U,13818
@@ -49,7 +49,7 @@ aiecs/infrastructure/persistence/__init__.py,sha256=yoog7fEHmhgY50vGdgDNqiZCPUUL
49
49
  aiecs/infrastructure/persistence/context_engine_client.py,sha256=KIzreimtg6WbuBYI4U0JTiRmNddpdpKHnGvuHVh86Hs,6051
50
50
  aiecs/infrastructure/persistence/database_manager.py,sha256=MRkMTALeeybzAfnfuJrOXbEchBCrMAgsz8YYyEUVMjI,12592
51
51
  aiecs/infrastructure/persistence/file_storage.py,sha256=Z8EozljYPBUuBTzDn2cM2uBEPp2uUW_eHLzwNxbKcOk,23889
52
- aiecs/infrastructure/persistence/redis_client.py,sha256=CqPtYFP8-KHl3cJG9VHun9YFFSp3kCc3ZaZbW7GlqUU,5791
52
+ aiecs/infrastructure/persistence/redis_client.py,sha256=ZwGvyiRrsFfC0N8-AGxTOh3FJuHXjt1Y1xjLZE8tKHg,7431
53
53
  aiecs/llm/__init__.py,sha256=QlpjRn6WK5rCC0Aswx4AeFmSAIxJQ0XyxjimrIee7jE,1860
54
54
  aiecs/llm/client_factory.py,sha256=534lVM4JplAFT-4tMHl4ebN9T9Cfz8WTyJjBGA9ly2s,14383
55
55
  aiecs/llm/callbacks/__init__.py,sha256=ewPn_AKobfdCkjxFJ1xlIM3bTWdmM01v4XT9_KUZTbg,192
@@ -58,7 +58,7 @@ aiecs/llm/clients/__init__.py,sha256=uQM004TQappwJMqTxVZNscpVPQtirkvYUPea3QYB7d0
58
58
  aiecs/llm/clients/base_client.py,sha256=j4NY-oEdG5ALBCSddblPpjttISn5teqLVVUuZyYn7g4,5880
59
59
  aiecs/llm/clients/googleai_client.py,sha256=sTgdw4eicxWruNGOMSsuEHbfF9RuDQo8SClqEtu1JOQ,6591
60
60
  aiecs/llm/clients/openai_client.py,sha256=x7Y_yTVu0kp-gu5Z-M0Bx-O20D0YDgZoJQxzkjNpr6c,4202
61
- aiecs/llm/clients/vertex_client.py,sha256=Vd5IJIvPVQuv0l6bMQmkY2aemrkfLoHY2RM5Z5SUhVg,17139
61
+ aiecs/llm/clients/vertex_client.py,sha256=nZA3Mi10VzzvLNKO6Td2o_B_TT6Mhi3J4Tm7_n3SZ94,18561
62
62
  aiecs/llm/clients/xai_client.py,sha256=XEELb9_qFeeQaansDWvAJRJVpt8CaBRLcYskuv9uDq0,6386
63
63
  aiecs/llm/config/__init__.py,sha256=KZbwHoBlbcN7HgNueA5p-0GpyVMJRNG1V5T-tkri8G4,1115
64
64
  aiecs/llm/config/config_loader.py,sha256=PTMsZax3CoTrMo6BZlUoI7takII3_DHm3w5xTKgBJpA,8921
@@ -168,9 +168,9 @@ aiecs/utils/prompt_loader.py,sha256=cBS2bZXpYQOWSiOGkhwIzyy3_bETqwIblRi_9qQT9iQ,
168
168
  aiecs/utils/token_usage_repository.py,sha256=1xjenLYwC0YT6lKZFEGO4scRCXLuWdec2MWjzih5SZY,10210
169
169
  aiecs/ws/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
170
170
  aiecs/ws/socket_server.py,sha256=j_9idVY_rWlTsF51FgmuhWCWFVt7_gAHL8vNg3IxV5g,1476
171
- aiecs-1.3.5.dist-info/licenses/LICENSE,sha256=_1YRaIS0eZu1pv6xfz245UkU0i1Va2B841hv3OWRwqg,12494
172
- aiecs-1.3.5.dist-info/METADATA,sha256=34_y02-Q5OdrWlquol8HuRW0QOgP6WRrSHM9uCaYuQM,16635
173
- aiecs-1.3.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
174
- aiecs-1.3.5.dist-info/entry_points.txt,sha256=TfLBuwLOfgQqKvnoF1sgTS19-Hgl0aWvCZjIdblIiig,667
175
- aiecs-1.3.5.dist-info/top_level.txt,sha256=22IlUlOqh9Ni3jXlQNMNUqzbW8dcxXPeR_EQ-BJVcV8,6
176
- aiecs-1.3.5.dist-info/RECORD,,
171
+ aiecs-1.3.8.dist-info/licenses/LICENSE,sha256=_1YRaIS0eZu1pv6xfz245UkU0i1Va2B841hv3OWRwqg,12494
172
+ aiecs-1.3.8.dist-info/METADATA,sha256=hwbEpECNoFi-BV_9iTlCcn3TiW9v-gKR1jkzukDbuvQ,16635
173
+ aiecs-1.3.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
174
+ aiecs-1.3.8.dist-info/entry_points.txt,sha256=TfLBuwLOfgQqKvnoF1sgTS19-Hgl0aWvCZjIdblIiig,667
175
+ aiecs-1.3.8.dist-info/top_level.txt,sha256=22IlUlOqh9Ni3jXlQNMNUqzbW8dcxXPeR_EQ-BJVcV8,6
176
+ aiecs-1.3.8.dist-info/RECORD,,
File without changes