feelings
Ruby gem for probabilistic conditionals like Feelings(msg).like?("urgent"), answered by Jev or other decision models.
Overview
feelings brings the feels construct from the Probably language to Ruby. Feelings(value).like?("genuinely urgent") asks a yes/no question and returns true or false; like returns a Mood with yes, maybe and no branches, and declaring a maybe branch widens the split to 0.3/0.7 so ambiguous answers have somewhere to go. Passing at_least: sets a probability floor and returns nil for the middle zone rather than forcing a guess. most_like picks the best label from a set and returns its symbol. Descriptions and label sets can live in YAML.
The default judge is the ruby_decision_model gem, so it works with every decision model that gem reaches: TypeSafe's Jev, OpenAI's gpt-6-luna, Cloudflare's Clef, Perplexity's pplx-decider, Databricks and self-hosted System One servers. Setting OPENROUTER_API_KEY or TYPESAFE_API_KEY is enough; other vendors are chosen with an environment variable.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Yes / no | Is this value like the description (e.g. spam, a security incident)? | yes · maybe · no |
| Choice | Which label best fits this value (most_like)? | — |
How it works
- Wrap a value with Feelings()
- Call like?, like or most_like
- ruby_decision_model queries the configured provider
- Branch on true/false/nil or yes/maybe/no
Strengths
- Idiomatic Ruby API with explicit maybe handling
- Provider-neutral via ruby_decision_model
- No config beyond an API key
Caveats
- Early gem
- Accuracy depends on the chosen provider
Getting started
gem "feelings", set TYPESAFE_API_KEY or OPENROUTER_API_KEY, then Feelings("that email").like?("genuinely urgent").At a glance
- Type
- Project
- Status
- beta
- Language
- Ruby
- Runtime
- gem
- Has code
- yes
Use cases and integrations
How curated lists describe it
Probabilistic conditionals for Ruby, `Feelings(message).like?("genuinely urgent")`, answered by a decision model through ruby_decision_model, with descriptions and label sets in YAML.
MrJev/awesome-jev
Frequently asked questions
Which providers work?
Jev, OpenAI gpt-6-luna, Cloudflare Clef, Perplexity pplx-decider, Databricks and System One servers.
How are uncertain answers handled?
With a maybe branch or a nil result below the at_least floor.
What is it inspired by?
The Probably toy language's feels construct.
Related projects
Go integration bringing TypeSafe Choice, Score and Noul to Google's adk-go agents, with a typed client, routing agent and callbacks.
ProjectbetaGoAx, a DSPy-style multi-language LLM framework, listed with a native TypeSafe provider for Boolean, Choice, Score and raw Jev questions.
PluginproductionTypeScriptEffect TypeScript library whose @effect/ai-typesafe package maps classify, probability and rating operations to Jev questions.
ProjectproductionTypeScriptPHP monorepo whose Polyglot module adds a TypeSafe driver for typed Noul, Choice and Score decisions alongside LLM inference.
ProjectproductionPHPSimon Willison's LLM plugin that adds Jev as a model for yes/no, choice and score questions from the command line.
PluginproductionPythonElixir library for unified LLM calls across providers, with an evaluate interface that calls Jev via TypeSafe or OpenRouter.
ProjectproductionElixir