sycommon-python-lib 0.2.4a7__py3-none-any.whl → 0.2.5__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.
- sycli/cdp/client.py +7 -0
- sycommon/agent/chat_events.py +36 -0
- sycommon/agent/deep_agent.py +746 -86
- sycommon/agent/mcp/models.py +4 -0
- sycommon/agent/mcp/tool_loader.py +145 -44
- sycommon/agent/multi_agent_team.py +39 -51
- sycommon/agent/sandbox/file_ops.py +71 -16
- sycommon/agent/sandbox/http_sandbox_backend.py +470 -253
- sycommon/agent/sandbox/minio_sync.py +45 -3
- sycommon/agent/summarization_utils.py +154 -2
- sycommon/auth/__init__.py +23 -0
- sycommon/auth/oa_cache.py +95 -0
- sycommon/auth/oa_crypto.py +60 -0
- sycommon/auth/oa_service.py +201 -0
- sycommon/auth/wecom_ldap_service.py +284 -101
- sycommon/database/async_base_db_service.py +82 -4
- sycommon/database/async_database_service.py +12 -2
- sycommon/database/base_db_service.py +84 -0
- sycommon/database/database_service.py +12 -2
- sycommon/database/pg_checkpoint_service.py +21 -1
- sycommon/llm/llm_with_token_tracking.py +27 -9
- sycommon/llm/struct_token.py +69 -10
- sycommon/llm/tiktoken_cache/9b5ad71b2ce5302211f9c61530b329a4922fc6a4 +100256 -0
- sycommon/llm/tiktoken_cache/fb374d419588a4632f3f557e76b4b70aebbca790 +199998 -0
- sycommon/llm/token_utils.py +96 -0
- sycommon/llm/usage_token.py +25 -0
- sycommon/logging/kafka_log.py +71 -9
- sycommon/mcp_server/__init__.py +13 -0
- sycommon/mcp_server/server.py +184 -0
- sycommon/middleware/middleware.py +4 -0
- sycommon/middleware/sandbox.py +306 -629
- sycommon/middleware/tool_result_truncation.py +154 -21
- sycommon/middleware/traceid.py +2 -10
- sycommon/models/mcp_server_config.py +36 -0
- sycommon/models/mqlistener_config.py +2 -0
- sycommon/models/sandbox.py +11 -0
- sycommon/rabbitmq/process_pool_consumer.py +4 -4
- sycommon/rabbitmq/rabbitmq_client.py +151 -81
- sycommon/rabbitmq/rabbitmq_service_client_manager.py +26 -18
- sycommon/rabbitmq/rabbitmq_service_connection_monitor.py +55 -4
- sycommon/rabbitmq/rabbitmq_service_consumer_manager.py +19 -22
- sycommon/rabbitmq/rabbitmq_service_producer_manager.py +2 -1
- sycommon/services.py +51 -2
- sycommon/synacos/nacos_service.py +4 -4
- sycommon/tests/test_consumer_loss_rootcause.py +399 -0
- sycommon/tests/test_consumer_recovery.py +283 -0
- sycommon/tests/test_dynamic_max_tokens.py +372 -0
- sycommon/tests/test_encoding_cache.py +148 -0
- sycommon/tests/test_fix_verification.py +404 -0
- sycommon/tests/test_mcp_server.py +401 -0
- sycommon/tests/test_minimax_reasoning.py +290 -0
- sycommon/tests/test_oa_login.py +229 -0
- sycommon/tests/test_summary_leak_e2e.py +872 -0
- sycommon/tools/snowflake.py +32 -76
- {sycommon_python_lib-0.2.4a7.dist-info → sycommon_python_lib-0.2.5.dist-info}/METADATA +40 -39
- {sycommon_python_lib-0.2.4a7.dist-info → sycommon_python_lib-0.2.5.dist-info}/RECORD +59 -42
- sycommon/middleware/background_execution.py +0 -568
- {sycommon_python_lib-0.2.4a7.dist-info → sycommon_python_lib-0.2.5.dist-info}/WHEEL +0 -0
- {sycommon_python_lib-0.2.4a7.dist-info → sycommon_python_lib-0.2.5.dist-info}/entry_points.txt +0 -0
- {sycommon_python_lib-0.2.4a7.dist-info → sycommon_python_lib-0.2.5.dist-info}/top_level.txt +0 -0
sycli/cdp/client.py
CHANGED
|
@@ -29,6 +29,13 @@ class CDPClient:
|
|
|
29
29
|
|
|
30
30
|
# ── Connection lifecycle ──────────────────────────────────────
|
|
31
31
|
|
|
32
|
+
async def __aenter__(self) -> CDPClient:
|
|
33
|
+
await self.connect()
|
|
34
|
+
return self
|
|
35
|
+
|
|
36
|
+
async def __aexit__(self, *exc) -> None:
|
|
37
|
+
await self.close()
|
|
38
|
+
|
|
32
39
|
async def connect(self) -> None:
|
|
33
40
|
self._session = aiohttp.ClientSession()
|
|
34
41
|
self._ws = await self._session.ws_connect(
|
sycommon/agent/chat_events.py
CHANGED
|
@@ -62,6 +62,9 @@ class EventType(str, Enum):
|
|
|
62
62
|
PARALLEL_AGENTS = "parallel_agents" # 并行 Agent
|
|
63
63
|
AGENT_COMPLETE = "agent_complete" # Agent 任务完成
|
|
64
64
|
|
|
65
|
+
# 评分相关
|
|
66
|
+
RUBRIC_EVALUATION = "rubric_evaluation" # Rubric 评估结果
|
|
67
|
+
|
|
65
68
|
# 生命周期
|
|
66
69
|
DONE = "done" # 完成
|
|
67
70
|
ERROR = "error" # 错误
|
|
@@ -368,6 +371,39 @@ class ChatEventBuilder:
|
|
|
368
371
|
"""
|
|
369
372
|
return ChatEvent(EventType.CANCELLED, {"message": message})
|
|
370
373
|
|
|
374
|
+
# ============== 评分相关 ==============
|
|
375
|
+
|
|
376
|
+
@staticmethod
|
|
377
|
+
def rubric_evaluation(
|
|
378
|
+
iteration: int,
|
|
379
|
+
result: str,
|
|
380
|
+
criteria: list,
|
|
381
|
+
explanation: str = "",
|
|
382
|
+
agent: str = DEFAULT_AGENT_NAME,
|
|
383
|
+
) -> ChatEvent:
|
|
384
|
+
"""
|
|
385
|
+
构建 Rubric 评估事件
|
|
386
|
+
|
|
387
|
+
Args:
|
|
388
|
+
iteration: 评估迭代次数
|
|
389
|
+
result: 评估结果(satisfied / needs_revision / failed / max_iterations_reached / grader_error)
|
|
390
|
+
criteria: 各评分标准的判定列表
|
|
391
|
+
explanation: 评估说明
|
|
392
|
+
agent: Agent 名称
|
|
393
|
+
|
|
394
|
+
Returns:
|
|
395
|
+
ChatEvent: 评估事件
|
|
396
|
+
"""
|
|
397
|
+
data = {
|
|
398
|
+
"iteration": iteration,
|
|
399
|
+
"result": result,
|
|
400
|
+
"criteria": criteria,
|
|
401
|
+
"agent": agent,
|
|
402
|
+
}
|
|
403
|
+
if explanation:
|
|
404
|
+
data["explanation"] = explanation
|
|
405
|
+
return ChatEvent(EventType.RUBRIC_EVALUATION, data)
|
|
406
|
+
|
|
371
407
|
|
|
372
408
|
# ============== 便捷函数(直接返回字典,兼容旧代码) ==============
|
|
373
409
|
|