Files
ai-agent/internal/builders/agent_run_log_builder.go
T
mlogclub 1370e4b675 feat: enhance AI agent functionality with tool management and logging improvements
- Added AllowedToolCodes field to Context for managing tool access.
- Introduced ResumeSource in aiReplyTraceData to track resume points.
- Enhanced logging with additional fields: PlannedSkillName, SkillRouteTrace, InterruptType, ResumeSource, and FinalStatus.
- Implemented functions to parse and resolve allowed tool codes for agents and skills.
- Refactored skill definition creation and update logic to streamline request handling.
- Updated MCP tool catalog to include source type and integrated built-in tools.
- Improved UI components to display additional tool information and enhance user experience.
2026-04-10 14:43:57 +08:00

36 lines
1.1 KiB
Go

package builders
import (
"cs-agent/internal/models"
"cs-agent/internal/pkg/dto/response"
)
func BuildAgentRunLog(item *models.AgentRunLog) response.AgentRunLogResponse {
if item == nil {
return response.AgentRunLogResponse{}
}
return response.AgentRunLogResponse{
ID: item.ID,
ConversationID: item.ConversationID,
MessageID: item.MessageID,
AIAgentID: item.AIAgentID,
AIConfigID: item.AIConfigID,
UserMessage: item.UserMessage,
PlannedAction: item.PlannedAction,
PlannedSkillCode: item.PlannedSkillCode,
PlannedSkillName: item.PlannedSkillName,
SkillRouteTrace: item.SkillRouteTrace,
PlannedToolCode: item.PlannedToolCode,
PlanReason: item.PlanReason,
InterruptType: item.InterruptType,
ResumeSource: item.ResumeSource,
FinalAction: item.FinalAction,
FinalStatus: item.FinalStatus,
ReplyText: item.ReplyText,
ErrorMessage: item.ErrorMessage,
LatencyMs: item.LatencyMs,
TraceData: item.TraceData,
CreatedAt: item.CreatedAt.Format("2006-01-02 15:04:05"),
}
}