sycommon-python-lib 0.2.7a32__py3-none-any.whl → 0.2.7a34__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.
- sycommon/agent/deep_agent.py +2 -1
- sycommon/agent/middleware/sensitive_guard.py +119 -15
- sycommon/agent/multi_agent_team.py +17 -4
- sycommon/config/Config.py +2 -1
- sycommon/llm/llm_logger.py +30 -0
- {sycommon_python_lib-0.2.7a32.dist-info → sycommon_python_lib-0.2.7a34.dist-info}/METADATA +1 -1
- {sycommon_python_lib-0.2.7a32.dist-info → sycommon_python_lib-0.2.7a34.dist-info}/RECORD +10 -10
- {sycommon_python_lib-0.2.7a32.dist-info → sycommon_python_lib-0.2.7a34.dist-info}/WHEEL +0 -0
- {sycommon_python_lib-0.2.7a32.dist-info → sycommon_python_lib-0.2.7a34.dist-info}/entry_points.txt +0 -0
- {sycommon_python_lib-0.2.7a32.dist-info → sycommon_python_lib-0.2.7a34.dist-info}/top_level.txt +0 -0
sycommon/agent/deep_agent.py
CHANGED
|
@@ -378,7 +378,8 @@ class AgentConfig(BaseModel):
|
|
|
378
378
|
internal_model_name: Optional[str] = None
|
|
379
379
|
# 敏感检测提示词(应用层可覆盖);未传(None)用基础库 DEFAULT_DETECT_PROMPT
|
|
380
380
|
sensitive_detect_prompt: Optional[str] = None
|
|
381
|
-
# 命中敏感后的动作:"allow"=不检测放行;"downgrade"=降级内部模型继续;
|
|
381
|
+
# 命中敏感后的动作:"allow"=不检测放行;"downgrade"=降级内部模型继续;
|
|
382
|
+
# "block"=直接阻断不执行(检测整段上下文);"block_user_input"=阻断(仅检测最后一条 HumanMessage)。
|
|
382
383
|
sensitive_action: str = "allow"
|
|
383
384
|
|
|
384
385
|
# 系统提示词
|
|
@@ -250,13 +250,19 @@ class SensitiveGuardMiddleware(AgentMiddleware):
|
|
|
250
250
|
state: Optional[DowngradeState] = None,
|
|
251
251
|
# 应用层可覆盖检测提示词;未传(None)用 DEFAULT_DETECT_PROMPT
|
|
252
252
|
detect_prompt: Optional[str] = None,
|
|
253
|
-
# 命中敏感后的动作:"allow"=不检测放行;"downgrade"=降级内部模型继续;
|
|
253
|
+
# 命中敏感后的动作:"allow"=不检测放行;"downgrade"=降级内部模型继续;
|
|
254
|
+
# "block"=直接阻断(不调任何模型),检测整段上下文;
|
|
255
|
+
# "block_user_input"=直接阻断,但只检测最后一条 HumanMessage(用户本轮输入)。
|
|
254
256
|
action: str = "allow",
|
|
255
257
|
# 阻断模式下的异步提示回调(与 on_downgrade 区分文案);downgrade 模式不用
|
|
256
258
|
on_block: Optional[Callable[[], Awaitable[None]]] = None,
|
|
257
259
|
# 测试注入:绕过懒加载的真实 get_llm
|
|
258
260
|
_detector: Any = None,
|
|
259
261
|
_internal_raw: Any = None,
|
|
262
|
+
# 是否执行检测。多 agent 子 agent 传 False:它看到的「最后一条 HumanMessage」
|
|
263
|
+
# 多是协调者委派指令而非用户原文,重复判易误命中;改由协调者检测、子 agent 只靠
|
|
264
|
+
# 共享 DowngradeState 短路阻断。单 agent 始终 True(默认)。
|
|
265
|
+
detect: bool = True,
|
|
260
266
|
):
|
|
261
267
|
self._model_tier = model_tier
|
|
262
268
|
# None 时检测器/降级目标都用 get_llm() 读 nacos default 模型,不写死模型名
|
|
@@ -264,7 +270,18 @@ class SensitiveGuardMiddleware(AgentMiddleware):
|
|
|
264
270
|
self._on_downgrade = on_downgrade
|
|
265
271
|
self._on_block = on_block
|
|
266
272
|
# 默认 allow(不检测):应用层未显式指定时按"放行"处理,避免误伤。
|
|
267
|
-
self._action = action if action in ("downgrade", "block", "allow") else "allow"
|
|
273
|
+
self._action = action if action in ("downgrade", "block", "block_user_input", "allow") else "allow"
|
|
274
|
+
self._detect_enabled = detect
|
|
275
|
+
# 单轮「有附件降 block」标志:仅 block_user_input 模式下,应用层每轮 chat 前按
|
|
276
|
+
# has_file 刷新。True → 本轮按 block 行为检测(整段上下文,含工具结果/附件正文);
|
|
277
|
+
# False → 按 block_user_input(仅最后一条 HumanMessage)。绝不改 _action,避免
|
|
278
|
+
# 与用户配的真 block 混淆(set_file_turn_degrade 在非 block_user_input 上为 no-op)。
|
|
279
|
+
self._file_turn_degrade = False
|
|
280
|
+
# 本轮(last_human 范围)「用户输入已判过」标志:block_user_input 无附件时,
|
|
281
|
+
# 同一轮里用户输入恒定不变,第一次判过即可,工具执行后再进模型节点不再重复判
|
|
282
|
+
# (重复判定等价于白烧一次内网调用,见 awrap_model_call (c) last_human 分支)。
|
|
283
|
+
# 每轮 chat 前由 set_file_turn_degrade() 重置;命中敏感走 (b) 短路,本标志无影响。
|
|
284
|
+
self._last_human_judged = False
|
|
268
285
|
self._enabled = enabled
|
|
269
286
|
self._state = state or DowngradeState()
|
|
270
287
|
self._detect_prompt = detect_prompt or DEFAULT_DETECT_PROMPT
|
|
@@ -276,15 +293,53 @@ class SensitiveGuardMiddleware(AgentMiddleware):
|
|
|
276
293
|
def is_downgraded(self) -> bool:
|
|
277
294
|
return self._state.is_downgraded
|
|
278
295
|
|
|
296
|
+
@property
|
|
297
|
+
def _is_block_turn(self) -> bool:
|
|
298
|
+
"""本轮是否走阻断路径(命中即返空响应、不调任何模型)。
|
|
299
|
+
|
|
300
|
+
block 和 block_user_input 都是阻断型 action;降级标志只改「检测范围」
|
|
301
|
+
(effective_detect_messages: last_human vs all),不改「是否阻断」。
|
|
302
|
+
is_blocked 与 awrap_model_call 的 (b)(d) 共用本判定。
|
|
303
|
+
"""
|
|
304
|
+
return self._action in ("block", "block_user_input")
|
|
305
|
+
|
|
279
306
|
@property
|
|
280
307
|
def is_blocked(self) -> bool:
|
|
281
|
-
"""
|
|
282
|
-
|
|
308
|
+
"""本会话是否已阻断(命中过敏感且本轮 action 是阻断型)。
|
|
309
|
+
action ∈ {block, block_user_input} 时为 True(两者都是阻断型 action)。
|
|
310
|
+
降级标志只改检测范围(effective_detect_messages),不改是否阻断。"""
|
|
311
|
+
return self._state.is_downgraded and self._is_block_turn
|
|
283
312
|
|
|
284
313
|
@property
|
|
285
314
|
def action(self) -> str:
|
|
286
315
|
return self._action
|
|
287
316
|
|
|
317
|
+
def set_file_turn_degrade(self, on: bool) -> None:
|
|
318
|
+
"""单轮「有附件降 block」标志开关(仅对 base=block_user_input 生效)。
|
|
319
|
+
|
|
320
|
+
应用层每轮 agent.chat 开始前按本轮 has_file 调用:
|
|
321
|
+
- has_file=True → on=True 本轮按 block 行为检测(整段上下文)
|
|
322
|
+
- has_file=False → on=False 本轮按 block_user_input 行为检测(仅用户输入)
|
|
323
|
+
只在 self._action == "block_user_input" 时生效;其它 base(allow/downgrade/block)
|
|
324
|
+
调本方法为 no-op(且强制清标志防残留),绝不改 _action。
|
|
325
|
+
"""
|
|
326
|
+
if self._action == "block_user_input":
|
|
327
|
+
self._file_turn_degrade = bool(on)
|
|
328
|
+
else:
|
|
329
|
+
self._file_turn_degrade = False
|
|
330
|
+
# 每轮 chat 开始时调用 → 重置「本轮用户输入已判过」标志。
|
|
331
|
+
# 新一轮用户输入到来,上一轮的判定结论不再复用,需重新判一次。
|
|
332
|
+
self._last_human_judged = False
|
|
333
|
+
|
|
334
|
+
@property
|
|
335
|
+
def effective_detect_messages(self) -> str:
|
|
336
|
+
"""本轮检测范围标识:'all'(整段上下文)/ 'last_human'(仅最后一条 HumanMessage)。
|
|
337
|
+
block_user_input + 降级标志 → 'all';block_user_input 无标志 → 'last_human';
|
|
338
|
+
block/downgrade → 'all';allow 由 (a) 短路不检测。"""
|
|
339
|
+
if self._action == "block_user_input" and not self._file_turn_degrade:
|
|
340
|
+
return "last_human"
|
|
341
|
+
return "all"
|
|
342
|
+
|
|
288
343
|
@property
|
|
289
344
|
def last_notice_source(self) -> str:
|
|
290
345
|
"""首次命中时的敏感来源(user_input/tool_result/history),供应用层选文案。"""
|
|
@@ -294,6 +349,18 @@ class SensitiveGuardMiddleware(AgentMiddleware):
|
|
|
294
349
|
def state(self) -> DowngradeState:
|
|
295
350
|
return self._state
|
|
296
351
|
|
|
352
|
+
@staticmethod
|
|
353
|
+
def _last_human(messages: List[BaseMessage]) -> Optional[List[BaseMessage]]:
|
|
354
|
+
"""取最后一条 HumanMessage,包装成单元素列表供 _detect 使用。
|
|
355
|
+
|
|
356
|
+
block_user_input 模式只检测用户本轮输入(含附件正文),工具结果/历史不进检测。
|
|
357
|
+
无 HumanMessage 返回 None(调用方放行)。
|
|
358
|
+
"""
|
|
359
|
+
for m in reversed(messages):
|
|
360
|
+
if isinstance(m, HumanMessage):
|
|
361
|
+
return [m]
|
|
362
|
+
return None
|
|
363
|
+
|
|
297
364
|
async def _get_detector(self):
|
|
298
365
|
if self._detector is None:
|
|
299
366
|
async with self._init_lock:
|
|
@@ -333,6 +400,17 @@ class SensitiveGuardMiddleware(AgentMiddleware):
|
|
|
333
400
|
识别失败时 fail-open 视为不敏感(默认放行),避免误伤正常请求。
|
|
334
401
|
"""
|
|
335
402
|
content = _messages_to_text(messages)
|
|
403
|
+
# 🔍 sensitive judge 诊断:打印本轮发出去的 content 字符数 + action + 范围
|
|
404
|
+
# block_user_input 应只发最后一条 HumanMessage(短);命中场景下若 chars 异常大,
|
|
405
|
+
# 说明检测范围没按 has_file 切换。仅打印长度与首尾摘要,不泄露正文。
|
|
406
|
+
try:
|
|
407
|
+
_action_now = getattr(self, "action", None) or getattr(self, "_action", None)
|
|
408
|
+
SYLogger.info(
|
|
409
|
+
f"[SensitiveGuard][Detect] 发起判定: action={_action_now} "
|
|
410
|
+
f"messages={len(messages)} content_chars={len(content)} "
|
|
411
|
+
f"head={content[:80]!r} tail={content[-80:]!r}")
|
|
412
|
+
except Exception:
|
|
413
|
+
pass
|
|
336
414
|
try:
|
|
337
415
|
detector = await self._get_detector()
|
|
338
416
|
# 🔑 提示词模板里含 {content} 占位符(应用层 SENSITIVE_DETECT_PROMPT)。
|
|
@@ -377,27 +455,53 @@ class SensitiveGuardMiddleware(AgentMiddleware):
|
|
|
377
455
|
if not self._enabled or self._model_tier == "internal" or self._action == "allow":
|
|
378
456
|
return await handler(request)
|
|
379
457
|
|
|
380
|
-
# (b)
|
|
458
|
+
# (b) 本会话已命中敏感(共享 state 已 downgraded)
|
|
381
459
|
if self._state.is_downgraded:
|
|
382
|
-
#
|
|
383
|
-
|
|
384
|
-
# 不进工具循环(无 tool_calls),干净结束。
|
|
385
|
-
if self._action == "block":
|
|
460
|
+
# 阻断路径(真 block 或 block_user_input+降级标志):返回空响应,不再调模型。
|
|
461
|
+
if self._is_block_turn:
|
|
386
462
|
return ModelResponse(result=[AIMessage(content="")])
|
|
387
|
-
#
|
|
463
|
+
# 降级模式(downgrade,或 block_user_input 非降级轮——后者理论不会到这因 (c) 只判用户输入):
|
|
464
|
+
# 路由内部模型继续;本次输入若非敏感(来自历史记忆)刷新 source=history
|
|
388
465
|
await self._refresh_source_if_history(request.messages)
|
|
389
466
|
return await handler(request.override(model=await self._get_internal_raw()))
|
|
390
467
|
|
|
391
|
-
# (
|
|
392
|
-
|
|
468
|
+
# (b') detect=False 且尚未命中:放行(多 agent 子 agent 不主动检测,
|
|
469
|
+
# 等协调者命中后由共享 state 在 (b) 短路阻断)。
|
|
470
|
+
if not self._detect_enabled:
|
|
471
|
+
return await handler(request)
|
|
472
|
+
|
|
473
|
+
# (c) 检测:按 effective_detect_messages 选喂给 detector 的消息范围
|
|
474
|
+
# block_user_input 无降级标志 → 仅最后一条 HumanMessage;其余(block/downgrade/
|
|
475
|
+
# block_user_input+降级;allow 已在 (a) 短路不会到这)→ 整段上下文
|
|
476
|
+
if self.effective_detect_messages == "last_human":
|
|
477
|
+
detect_messages = self._last_human(request.messages)
|
|
478
|
+
if detect_messages is None:
|
|
479
|
+
# 无用户输入(理论上不会发生)→ 无从检测,放行
|
|
480
|
+
return await handler(request)
|
|
481
|
+
# 🔑 block_user_input 无附件:本轮只判一次用户输入。
|
|
482
|
+
# 工具执行后模型节点会再次进入本方法,但用户输入本轮恒定不变 → 直接放行,
|
|
483
|
+
# 不重复调 detector(省一次内网判定调用 + 3s 延迟)。命中过则已在 (b) 短路,
|
|
484
|
+
# 不会走到这。set_file_turn_degrade() 每轮 chat 前会清本标志。
|
|
485
|
+
if self._last_human_judged:
|
|
486
|
+
SYLogger.info(
|
|
487
|
+
"[SensitiveGuard][Detect] 本轮用户输入已判过,跳过重复判定(last_human)")
|
|
488
|
+
return await handler(request)
|
|
489
|
+
else:
|
|
490
|
+
# block / downgrade / block_user_input+降级:整段上下文
|
|
491
|
+
detect_messages = request.messages
|
|
492
|
+
|
|
493
|
+
check = await self._detect(detect_messages)
|
|
494
|
+
# last_human 范围:无论命中与否,本轮用户输入的判定已完成,置位避免重复判定。
|
|
495
|
+
if self.effective_detect_messages == "last_human":
|
|
496
|
+
self._last_human_judged = True
|
|
393
497
|
if not check.is_sensitive:
|
|
394
498
|
return await handler(request)
|
|
395
499
|
|
|
396
|
-
# (d) 命中 → CAS
|
|
500
|
+
# (d) 命中 → CAS 抢占;按本轮是否阻断路径分流
|
|
397
501
|
is_first = await self._state.mark_downgraded(check.source)
|
|
398
|
-
if self.
|
|
502
|
+
if self._is_block_turn:
|
|
399
503
|
SYLogger.info(
|
|
400
|
-
f"[SensitiveGuard] 命中敏感信息,阻断执行: {check.reason} (source={check.source})")
|
|
504
|
+
f"[SensitiveGuard] 命中敏感信息,阻断执行: {check.reason} (source={check.source}, action={self._action})")
|
|
401
505
|
if is_first and self._on_block:
|
|
402
506
|
try:
|
|
403
507
|
await self._on_block()
|
|
@@ -134,7 +134,7 @@ class TeamConfig(BaseModel):
|
|
|
134
134
|
sensitive_guard: bool = True # 是否启用敏感信息检测守卫
|
|
135
135
|
internal_model_name: Optional[str] = None # 敏感降级目标内部模型名(应用层透传)
|
|
136
136
|
sensitive_detect_prompt: Optional[str] = None # 敏感检测提示词(应用层覆盖)
|
|
137
|
-
sensitive_action: str = "allow" # "allow"=不检测放行;"downgrade"=降级继续;"block"=阻断
|
|
137
|
+
sensitive_action: str = "allow" # "allow"=不检测放行;"downgrade"=降级继续;"block"=阻断(整段上下文);"block_user_input"=阻断(仅检测用户输入)
|
|
138
138
|
|
|
139
139
|
coordinator_prompt: str = ""
|
|
140
140
|
coordinator_name: str = "项目经理"
|
|
@@ -200,6 +200,7 @@ class MultiAgentTeam:
|
|
|
200
200
|
coordinator_name: str = "项目经理",
|
|
201
201
|
recovery_manager: Optional[SandboxRecoveryManager] = None,
|
|
202
202
|
downgrade_state: Optional[DowngradeState] = None,
|
|
203
|
+
sensitive_guard: Optional["SensitiveGuardMiddleware"] = None,
|
|
203
204
|
):
|
|
204
205
|
self.user_id = user_id
|
|
205
206
|
self.agent = agent
|
|
@@ -210,6 +211,10 @@ class MultiAgentTeam:
|
|
|
210
211
|
self.sandbox_backend = sandbox_backend
|
|
211
212
|
self.recovery_manager = recovery_manager
|
|
212
213
|
self.downgrade_state = downgrade_state
|
|
214
|
+
# 协调者的敏感检测 guard 实例(build 时传入)。暴露给应用层读 guard 状态
|
|
215
|
+
# (is_downgraded / last_notice_source / set_file_turn_degrade 等),
|
|
216
|
+
# 让单 agent 与 multi-agent 的应用层代码统一走 `getattr(agent, "sensitive_guard", None)`。
|
|
217
|
+
self.sensitive_guard = sensitive_guard
|
|
213
218
|
|
|
214
219
|
@property
|
|
215
220
|
def is_downgraded(self) -> bool:
|
|
@@ -628,7 +633,9 @@ async def create_multi_agent_team(
|
|
|
628
633
|
# 任一命中 → 全员降级(敏感数据会经委派链流动,独立 state 会漏)。
|
|
629
634
|
shared_downgrade_state = DowngradeState()
|
|
630
635
|
|
|
631
|
-
def _make_guard():
|
|
636
|
+
def _make_guard(detect: bool = True):
|
|
637
|
+
"""协调者 detect=True(检测用户输入);子 agent detect=False
|
|
638
|
+
(只靠共享 state 短路阻断,不把委派指令当用户输入重复判)。"""
|
|
632
639
|
return SensitiveGuardMiddleware(
|
|
633
640
|
model_tier=config.model_tier,
|
|
634
641
|
enabled=config.sensitive_guard,
|
|
@@ -636,10 +643,11 @@ async def create_multi_agent_team(
|
|
|
636
643
|
internal_model_name=config.internal_model_name,
|
|
637
644
|
detect_prompt=config.sensitive_detect_prompt,
|
|
638
645
|
action=config.sensitive_action,
|
|
646
|
+
detect=detect,
|
|
639
647
|
)
|
|
640
648
|
|
|
641
649
|
middleware = [
|
|
642
|
-
_make_guard(),
|
|
650
|
+
_make_guard(detect=False),
|
|
643
651
|
ToolResultTruncationMiddleware(),
|
|
644
652
|
TokenTrackingMiddleware(model_name=config.model_name, user_id=user_id),
|
|
645
653
|
summarization_mw,
|
|
@@ -686,6 +694,10 @@ async def create_multi_agent_team(
|
|
|
686
694
|
# 创建协调者 Agent
|
|
687
695
|
coord_name = config.coordinator_name
|
|
688
696
|
coord_summarization_mw = build_summarization_middleware(model, config.model_name, sandbox_backend)
|
|
697
|
+
# 协调者 guard 实例:单独构造,传给 MultiAgentTeam.sensitive_guard 供应用层读取
|
|
698
|
+
# (与单 agent 的 agent.sensitive_guard 对齐)。
|
|
699
|
+
coord_guard = _make_guard(detect=True)
|
|
700
|
+
|
|
689
701
|
coordinator_agent = create_deep_agent(
|
|
690
702
|
model=model,
|
|
691
703
|
tools=config.shared_tools or [get_current_date],
|
|
@@ -698,7 +710,7 @@ async def create_multi_agent_team(
|
|
|
698
710
|
debug=config.debug,
|
|
699
711
|
name=coord_name,
|
|
700
712
|
middleware=[
|
|
701
|
-
|
|
713
|
+
coord_guard,
|
|
702
714
|
ToolResultTruncationMiddleware(),
|
|
703
715
|
TokenTrackingMiddleware(model_name=config.model_name, user_id=user_id),
|
|
704
716
|
coord_summarization_mw,
|
|
@@ -718,6 +730,7 @@ async def create_multi_agent_team(
|
|
|
718
730
|
coordinator_name=coord_name,
|
|
719
731
|
recovery_manager=recovery_manager,
|
|
720
732
|
downgrade_state=shared_downgrade_state,
|
|
733
|
+
sensitive_guard=coord_guard,
|
|
721
734
|
)
|
|
722
735
|
|
|
723
736
|
|
sycommon/config/Config.py
CHANGED
|
@@ -186,7 +186,8 @@ class Config(metaclass=SingletonMeta):
|
|
|
186
186
|
# 但消费方按顶层 key 读取(LLMConfig 等)——提升到顶层,免得每个调用方都得知道嵌套路径。
|
|
187
187
|
override_keys = ['LLMConfig', 'EmbeddingConfig', 'RerankerConfig',
|
|
188
188
|
'ACPAgentConfig',
|
|
189
|
-
'SkillApiWhitelist'
|
|
189
|
+
'SkillApiWhitelist',
|
|
190
|
+
'SensitiveConfig']
|
|
190
191
|
for k in override_keys:
|
|
191
192
|
if k in project_cfg:
|
|
192
193
|
self.config[k] = project_cfg[k]
|
sycommon/llm/llm_logger.py
CHANGED
|
@@ -29,6 +29,36 @@ class LLMLogger(AsyncCallbackHandler):
|
|
|
29
29
|
**kwargs: Any
|
|
30
30
|
) -> None:
|
|
31
31
|
model_name = serialized.get('name', 'unknown')
|
|
32
|
+
# 🔍 每次模型调用诊断:模型名 + 消息组数 + 各组消息类型/条数 + 每组总字符数
|
|
33
|
+
# (字符数≈4×token,可粗判 input 是否「固定长度分类器」还是「全文上下文」)。
|
|
34
|
+
# 跨意图识别/sensitive judge/主对话/rubric 全覆盖。
|
|
35
|
+
try:
|
|
36
|
+
groups_summary = []
|
|
37
|
+
for gi, group in enumerate(messages):
|
|
38
|
+
chars = 0
|
|
39
|
+
type_counts: Dict[str, int] = {}
|
|
40
|
+
for m in group:
|
|
41
|
+
c = m.content
|
|
42
|
+
if isinstance(c, str):
|
|
43
|
+
chars += len(c)
|
|
44
|
+
elif isinstance(c, list):
|
|
45
|
+
# 多模态:累加每个块的 text 长度
|
|
46
|
+
for blk in c:
|
|
47
|
+
if isinstance(blk, dict):
|
|
48
|
+
chars += len(str(blk.get("text", "")))
|
|
49
|
+
else:
|
|
50
|
+
chars += len(str(blk))
|
|
51
|
+
else:
|
|
52
|
+
chars += len(str(c))
|
|
53
|
+
t = getattr(m, "type", type(m).__name__)
|
|
54
|
+
type_counts[t] = type_counts.get(t, 0) + 1
|
|
55
|
+
groups_summary.append(
|
|
56
|
+
f"#{gi+1} msgs={len(group)} chars={chars} types={type_counts}")
|
|
57
|
+
SYLogger.info(
|
|
58
|
+
f"[LLM-DIAG] 调用开始 model={model_name} 组数={len(messages)} | "
|
|
59
|
+
f"{' || '.join(groups_summary)}")
|
|
60
|
+
except Exception as _e:
|
|
61
|
+
SYLogger.warning(f"[LLM-DIAG] 诊断统计失败(非致命): {_e}")
|
|
32
62
|
SYLogger.info(
|
|
33
63
|
f"聊天模型调用开始 | 模型: {model_name} | 消息组数: {len(messages)}")
|
|
34
64
|
self._log_chat_messages(messages)
|
|
@@ -136,8 +136,8 @@ sycommon/services.py,sha256=iC73h5d5bpNqW2qjRUGODZFhUhcwvKVnKUFLKJlBSq0,25322
|
|
|
136
136
|
sycommon/agent/__init__.py,sha256=mxceAeUifQ-DKvWp7ZEJIFlmOCb5wpYHPGQw3rwEN8I,4378
|
|
137
137
|
sycommon/agent/agent_manager.py,sha256=UhhaekEumT7g4v_Z1UB4jTp13X0n8M8erYaQdkGGWkA,13620
|
|
138
138
|
sycommon/agent/chat_events.py,sha256=t7qWa6OrIWLfqtd1AnqaVP67QWkn1JxpCBTZYQpoLuM,14226
|
|
139
|
-
sycommon/agent/deep_agent.py,sha256=
|
|
140
|
-
sycommon/agent/multi_agent_team.py,sha256=
|
|
139
|
+
sycommon/agent/deep_agent.py,sha256=3HkzT08WKGgdgOB3YuxY6KO7sZF4PW0vxdRSZAjFV2k,78863
|
|
140
|
+
sycommon/agent/multi_agent_team.py,sha256=xY6JMr5TTAumTS7EV3Ye6vQL78Bv7wMEM7lzmP8lkeQ,31425
|
|
141
141
|
sycommon/agent/summarization_utils.py,sha256=yCMeg7vT78vYYRgpzR8paE2Yu27pcPQSY1zvWUbIP_I,18899
|
|
142
142
|
sycommon/agent/acp/__init__.py,sha256=vQGMQYAA5-ZaejYmDZ4r4Fklqs17qH3cDXQ5pZlwj-0,1844
|
|
143
143
|
sycommon/agent/acp/client.py,sha256=s-K626b9ierwyEq61gejrW0xOysvrY2PIpYFsFqSHjc,27108
|
|
@@ -148,7 +148,7 @@ sycommon/agent/mcp/__init__.py,sha256=iKrdDhIrFsNIkqG_kgcwNe-nOiM6uVfolKv44LfQ-F
|
|
|
148
148
|
sycommon/agent/mcp/models.py,sha256=zda4ho-UTYOJ5oPAZPZ-vxhfDRLghUCsMroHnA2A2QQ,1490
|
|
149
149
|
sycommon/agent/mcp/tool_loader.py,sha256=pwhZoSoZuQVYo6BgfdMoRHlGnRPDRxvOvxEgvUM5q7Q,17818
|
|
150
150
|
sycommon/agent/middleware/sandbox_path_guard.py,sha256=K1SnxA8pDxkCSucOkranwUvC9_8rd3l_-TIR8gMMTK8,8102
|
|
151
|
-
sycommon/agent/middleware/sensitive_guard.py,sha256=
|
|
151
|
+
sycommon/agent/middleware/sensitive_guard.py,sha256=B6Dpii3m-IU9qFrIUSUHbtjEwELRrHx2Iez-Ri0fDiM,30276
|
|
152
152
|
sycommon/agent/middleware/sitecustomize.py,sha256=Bt7XFnWV_LJo89l858AGp5VUkXwefpLGmjkCtLe-CMw,4800
|
|
153
153
|
sycommon/agent/middleware/skill_api_whitelist.py,sha256=2qVsrwS6VkkPKHrvjJMNUfBDokdMJkP-mn-V-ZCn7X8,16643
|
|
154
154
|
sycommon/agent/middleware/skill_wl_check.py,sha256=rCJ9F6aWPh8tVQBIPmcq2lKDsfwiJQduwSUku_8kXfs,3952
|
|
@@ -168,7 +168,7 @@ sycommon/auth/oa_crypto.py,sha256=xpY1R1Bj3KLENXB0TuThB6Eku1E9PYjcoSpOdgDmCgc,18
|
|
|
168
168
|
sycommon/auth/oa_service.py,sha256=kLepV9zgqpZoaB73DRPpMA5tJJQjoaDtQPdzBcGXeak,6235
|
|
169
169
|
sycommon/auth/wecom_ldap_service.py,sha256=atVuYs8zL1EfEN5yX9bwHcHpCsB3BdnMnMlR2bbmD6c,33416
|
|
170
170
|
sycommon/config/ACPAgentConfig.py,sha256=paAa0c0gy1RnDDum-Q6m7QLTe7lhz2dsFt4r72QtmWE,3202
|
|
171
|
-
sycommon/config/Config.py,sha256=
|
|
171
|
+
sycommon/config/Config.py,sha256=zbddvm2_y_l3k2zMeAZ0BTEST6Or_kUD7y21RnEy2Kc,7929
|
|
172
172
|
sycommon/config/DatabaseConfig.py,sha256=ILiUuYT9_xJZE2W-RYuC3JCt_YLKc1sbH13-MHIOPhg,804
|
|
173
173
|
sycommon/config/ElasticsearchConfig.py,sha256=fO9ZPMgJxSg1-UyDJ90wO6UvYy-jscwPJsSkXgx9qTU,2308
|
|
174
174
|
sycommon/config/EmbeddingConfig.py,sha256=gPKwiDYbeu1GpdIZXMmgqM7JqBIzCXi0yYuGRLZooMI,362
|
|
@@ -203,7 +203,7 @@ sycommon/heartbeat_process/heartbeat_process_worker.py,sha256=duuAEFwda43Y6pZE8t
|
|
|
203
203
|
sycommon/llm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
204
204
|
sycommon/llm/embedding.py,sha256=n2PtKlfJ4E1-V8DIHTilR-y9y1TYB5iaATlWOKjid28,19878
|
|
205
205
|
sycommon/llm/get_llm.py,sha256=Mi4rWB07QQzv0NgAGOCXyB9Yd7jl_MbKd1J5Qml8BMk,8402
|
|
206
|
-
sycommon/llm/llm_logger.py,sha256=
|
|
206
|
+
sycommon/llm/llm_logger.py,sha256=35R-6BOPKLe2FJA7PKeMPCMaPkFdSEc6_QERnHRhDcs,6114
|
|
207
207
|
sycommon/llm/llm_tokens.py,sha256=yGEessxfk5wRMrPGyWHhiiIIQFDVT23FSaqnwqHGCoY,4712
|
|
208
208
|
sycommon/llm/llm_with_token_tracking.py,sha256=VJYHQSSuqvAbJ7qFs7Zml_thFDZoqL2rXFj8Nrj6rNo,13834
|
|
209
209
|
sycommon/llm/native_with_fallback_runnable.py,sha256=8g2q8cRqJv2miY7GrZz_f-zNmHxdb_5WSujD3frqObQ,8035
|
|
@@ -311,8 +311,8 @@ sycommon/tools/syemail.py,sha256=BDFhgf7WDOQeTcjxJEQdu0dQhnHFPO_p3eI0-Ni3LhQ,561
|
|
|
311
311
|
sycommon/tools/timing.py,sha256=OiiE7P07lRoMzX9kzb8sZU9cDb0zNnqIlY5pWqHcnkY,2064
|
|
312
312
|
sycommon/xxljob/__init__.py,sha256=7eoBlQxv-B39IfRSCY2bkqdGYs1QRe1umAWd88VMEEM,86
|
|
313
313
|
sycommon/xxljob/xxljob_service.py,sha256=1yifwIBNGsCIxLnQjHKiBlbsigc_zvPH-dMTZcNxe-Q,7649
|
|
314
|
-
sycommon_python_lib-0.2.
|
|
315
|
-
sycommon_python_lib-0.2.
|
|
316
|
-
sycommon_python_lib-0.2.
|
|
317
|
-
sycommon_python_lib-0.2.
|
|
318
|
-
sycommon_python_lib-0.2.
|
|
314
|
+
sycommon_python_lib-0.2.7a34.dist-info/METADATA,sha256=g0qvNe0nB7HSgtEf-n3TBuARcIYTo8qdgkUJMYdge0M,7963
|
|
315
|
+
sycommon_python_lib-0.2.7a34.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
316
|
+
sycommon_python_lib-0.2.7a34.dist-info/entry_points.txt,sha256=gsR4SssKxDWjRU8ggidzNcdMXDPRSKRS7UaGyNP84Qg,92
|
|
317
|
+
sycommon_python_lib-0.2.7a34.dist-info/top_level.txt,sha256=RgphKrg7nJyZ7irJqbxFr-5H2LUYTvI7ivoWZH2hcD0,29
|
|
318
|
+
sycommon_python_lib-0.2.7a34.dist-info/RECORD,,
|
|
File without changes
|
{sycommon_python_lib-0.2.7a32.dist-info → sycommon_python_lib-0.2.7a34.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{sycommon_python_lib-0.2.7a32.dist-info → sycommon_python_lib-0.2.7a34.dist-info}/top_level.txt
RENAMED
|
File without changes
|