Typed AI decisions in Go. An unofficial Jev client for choosing values, estimating probabilities, and scoring against a rubric. Standard library only.
go get github.com/drpaneas/jevSet TYPESAFE_API_KEY, then run:
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/drpaneas/jev"
)
type Team string
func main() {
client, err := jev.New(os.Getenv("TYPESAFE_API_KEY"))
if err != nil {
log.Fatal(err)
}
question := jev.Choice("Which team should handle this ticket?",
jev.Opt(Team("billing"), "Payments and invoices"),
jev.Opt(Team("support"), "Bugs and outages"),
)
decision, err := client.Ask(context.Background(), "I was charged twice.", question)
if err != nil {
log.Fatal(err)
}
team, ok := decision.Resolve(0.90) // team has type Team
if !ok {
fmt.Println("Needs human review")
return
}
fmt.Println(team)
}| Question | Result | Meaning |
|---|---|---|
Choice |
Decision[T] |
Choose one of your typed values |
Noul |
Probability |
Estimate P(yes) |
Score |
Rating |
Probability-weighted position on your rubric |
Constructors build reusable questions locally. Ask calls Jev; Resolve applies
your confidence threshold locally. Choose thresholds using your own evaluation data.
Requests have a 30-second total timeout and up to two retries. Attempts may
be billed; use jev.WithMaxRetries(0) to disable retries.
Batching, configuration & errors · Complete example · Offline example · MIT license
Logo adapts the Go Gopher by Renee French, licensed CC BY 4.0.
