feat: improve agent collaboration observability

This commit is contained in:
2026-06-15 11:33:08 +08:00
parent 7b7c82309c
commit d5f1a4510f
13 changed files with 593 additions and 36 deletions
@@ -116,17 +116,12 @@ class IntentNode(BaseNode):
error='请至少配置一个意图',
)
if not model_id:
return NodeResult(
success=False,
error='请选择用于意图识别的模型',
)
llm_service = LLMService(context.db_session)
model_id = await llm_service.resolve_chat_model_id(model_id)
# 检查模型是否支持 Function Calling
supports_fc = self._check_model_supports_function_call(model_id)
llm_service = LLMService(context.db_session)
if supports_fc:
# 使用 Function Calling 方式(更准确)
intent_name, confidence, total_tokens = await self._execute_with_function_calling_async(
@@ -169,6 +164,7 @@ class IntentNode(BaseNode):
'intent': intent_name,
'confidence': confidence,
'matched_branch': next_node_id,
'model_id': model_id,
},
)