feat(t208): close candidate decision feedback loop
This commit is contained in:
@@ -216,6 +216,17 @@ func executionReportFrom(report *domain.ExecutionReport) *ExecutionReport {
|
||||
result.Candidates = prettyAuditJSON(&batch.CandidatesJSON)
|
||||
result.Recommendation = prettyAuditJSON(batch.RecommendationJSON)
|
||||
}
|
||||
if dataset := report.DecisionDataset; dataset != nil {
|
||||
result.Observations = prettyValueJSON(dataset.Observations)
|
||||
result.ModelPredictions = prettyValueJSON(map[string]any{
|
||||
"model_run": dataset.ModelRun,
|
||||
"evaluations": dataset.Evaluations,
|
||||
})
|
||||
result.DeterministicRecommendation = prettyValueJSON(
|
||||
dataset.Recommendation,
|
||||
)
|
||||
result.HumanReviews = prettyValueJSON(dataset.HumanReviews)
|
||||
}
|
||||
if outcome := report.Outcome; outcome != nil {
|
||||
result.Outcome = &ExecutionReportOutcome{
|
||||
ResultType: outcome.ResultType,
|
||||
@@ -247,6 +258,17 @@ func prettyAuditJSON(value *string) string {
|
||||
return string(formatted)
|
||||
}
|
||||
|
||||
func prettyValueJSON(value any) string {
|
||||
if value == nil {
|
||||
return ""
|
||||
}
|
||||
formatted, err := json.MarshalIndent(value, "", " ")
|
||||
if err != nil || string(formatted) == "null" || string(formatted) == "[]" {
|
||||
return ""
|
||||
}
|
||||
return string(formatted)
|
||||
}
|
||||
|
||||
func stringValue(value *string) string {
|
||||
if value == nil {
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user