Releases: Ray-Hughes/jevalyn
Releases · Ray-Hughes/jevalyn
Release list
v0.1.0 — first release
Jevalyn is the decision layer for your Rails app, built on TypeSafe's Jev.
class SupportTriage < Jevalyn::Decision
question :department, type: :choice,
instructions: "Which team should handle this?",
criteria: {
billing: "Payments, invoicing, refunds",
technical: "Bugs, outages, integrations",
sales: "Pricing, upgrades, new accounts"
},
confidence_threshold: 0.8
end
SupportTriage.evaluate(ticket.body).department # => :technicalJev is a System One model: you give it a state and typed questions, it gives back typed,
calibrated answers. A probability, one of your options, a level on your rubric. It does
not generate text, and Jevalyn does not pretend otherwise — what it does is make a
decision cheap and fast enough to sit directly in a Rails request.
What's in it
Decision— the question DSL, validated when the class body runs, so a rubric with
eleven score levels fails on boot rather than as a 422 on a Friday afternoon. All
questions go out in one request.- Per-question confidence floors —
confidence_threshold:on a question, with the
class-level value as the default. Routing to the wrong team costs more than a
roughly-right severity, and one number per decision cannot say that. Guardrail— a single-noul gate answering#allow?. Denies rather than failing
open when the API is unreachable.Router— dispatch on a choice answer with a confidence floor underneath, and a
build-time check that every option your criteria can return has a route.- Testing —
mock_modenever opens a connection; stubs expand friendly values
(true,:technical,"major") into responses the real API could have returned. An
unstubbed evaluation raises rather than answeringnil. Cassettes for the handful of
tests that should hit real answers. - Generators —
jevalyn:install,jevalyn:decision,jevalyn:guardrail, plus
rails jevalyn:ping.
Two things the docs will trip you on
Both cost me a rewrite, and they apply to any Jev client, not just this one:
- Noul answers carry no
confidence. TypeSafe returnsconfidenceon Choice and
Score only. For a noul the probability is the answer, and0.5is the model saying it
does not know. Jevalyn exposes#confidenceasniland derives#certaintyfrom
distance off a coin flip, so thresholds work across all three types. - A score answer is a weighted Float, not a level label.
2.4means past major and
heading for critical.#labelgives you the nearest level's name.
Requirements
Ruby 3.1+, Rails 7.0+. MIT. Unofficial and not affiliated with TypeSafe AI.
gem "jevalyn"167 examples, CI on Ruby 3.1–3.4. Bug reports and rubric-wording arguments both welcome.