MCPcopy Create free account
hub / github.com/53AI/53AIHub / parseSkillScanResultPayload

Function parseSkillScanResultPayload

api/service/skill_library_scan.go:1172–1184  ·  view source on GitHub ↗
(ctx context.Context, responseText string)

Source from the content-addressed store, hash-verified

1170}
1171
1172func parseSkillScanResultPayload(ctx context.Context, responseText string) (*skillScanResultPayload, error) {
1173 var payload skillScanResultPayload
1174 if err := common.ParseLLMJSONInto(ctx, responseText, &payload); err != nil {
1175 return nil, fmt.Errorf("scan response parse failed: %v", err)
1176 }
1177
1178 switch payload.RiskLevel {
1179 case model.SkillRiskLevelLow, model.SkillRiskLevelMedium, model.SkillRiskLevelHigh:
1180 default:
1181 payload.RiskLevel = model.SkillRiskLevelMedium
1182 }
1183 return &payload, nil
1184}
1185
1186func fallbackSkillScanOutput(in *SkillScanInput, reason string) *SkillScanOutput {
1187 riskLevel := model.SkillRiskLevelMedium

Callers 1

ScanMethod · 0.85

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected