feat(guards): judge calls record their payload and response, and the OpenAI Decisions API is a judge backend
publish / publish (push) Successful in 1m18s
publish / publish (push) Successful in 1m18s
This commit is contained in:
27 files changed
+2230
-99
No files matched your search
@@ -1,9 +1,11 @@
|
||||
// eval measures the confidence guard's judge on the labelled cases and writes
|
||||
// the result the guard reads at start. Run it from guards/confidence:
|
||||
//
|
||||
// go run ./cmd/eval -base <System One base URL> -model <model> -out eval_result.json
|
||||
// go run ./cmd/eval -api systemone -base <base URL> -model <model> -out eval_result.json
|
||||
// go run ./cmd/eval -api openai-decisions -model gpt-6-luna -out eval_result.openai-decisions.json
|
||||
//
|
||||
// The API key, when the endpoint needs one, is read from CONFIDENCE_JUDGE_API_KEY.
|
||||
// The API key is read from CONFIDENCE_JUDGE_API_KEY for systemone and from
|
||||
// OPENAI_API_KEY for openai-decisions.
|
||||
// The positive class is a diagnosis its evidence does not support.
|
||||
package main
|
||||
|
||||
@@ -15,7 +17,6 @@ import (
|
||||
|
||||
"github.com/samcharles93/archipelago/guards/confidence/internal/judge"
|
||||
"github.com/samcharles93/archipelago/sdk/judgegate"
|
||||
"github.com/samcharles93/archipelago/sdk/systemone"
|
||||
)
|
||||
|
||||
var threshold = judgegate.Threshold{
|
||||
@@ -58,13 +59,14 @@ func load(path string) ([]evalCase, error) {
|
||||
return f.Cases, nil
|
||||
}
|
||||
|
||||
func judgeCase(ctx context.Context, client systemone.Client, c evalCase) (judgegate.Graded, error) {
|
||||
func judgeCase(ctx context.Context, client judgegate.Client, c evalCase) (judgegate.Graded, error) {
|
||||
g := judgegate.Graded{ID: c.ID, Label: c.Label, Want: c.Label == judge.Unsupported}
|
||||
j, err := judge.New(client)
|
||||
if err != nil {
|
||||
return g, err
|
||||
}
|
||||
out, err := j.Assess(ctx, c.Case)
|
||||
g = out.Call.Attach(g)
|
||||
if err != nil {
|
||||
return g, err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user