Files
poimen-workflows/activity/judge.go
T

33 lines
704 B
Go
Raw Normal View History

package activity
import (
"context"
"github.com/rockliang/poimen/workflows/pkg/types"
)
type JudgeInput struct {
Config types.OrchestratorConfig
Diff string
IntegrationTestLogs string
}
type JudgeOutput struct {
Verdict string
Critique string
}
func JudgeActivity(ctx context.Context, in JudgeInput) (JudgeOutput, error) {
response, err := CallRoleLLM(ctx, in.Config, "judge", map[string]any{
"SystemPrompt": in.Config.SystemPrompt,
"Diff": in.Diff,
"TestResult": in.IntegrationTestLogs,
})
if err != nil {
return JudgeOutput{}, err
}
// TODO: parse LLM response for verdict
return JudgeOutput{Verdict: "pass", Critique: response}, nil
}