shipwithjev

Catalog / Tools & apps

0368GitHub

jevclient

Async Python client for typed Jev questions and probabilities.

AboveColin/jevclientREADME ↗
# jevclient

Async Python client for [TypeSafe](https://typesafe.ai) Jev, the System One decision
model. Jev answers typed questions about a state and returns values, so there is no
text to parse.

```python
import asyncio
from jevclient import JevClient, Noul, Choice, Score

async def main():
    async with JevClient("your-api-key") as jev:
        answers = await jev.ask(
            "The front door has been unlocked for 40 minutes and nobody is home.",
            {
                "warn": Noul("Should someone be warned about this?"),
                "area": Choice("Which area is this about?",
                               {"security": "Doors, locks, alarms",
                                "climate": "Heating and ventilation"}),
                "urgency": Score("How urgent is it?",
                                 ["Ignore", "Today", "Right now"]),
            },
        )
    print(answers["warn"].noul)          # 0.94
    print(answers["area"].choice)        # "security"
    print(answers["area"].probabilities) # {"security": 0.97, "climate": 0.03}
    print(answers["urgency"].score)      # 1.8, between "Today" and "Right now"

asyncio.run(main())
```

## Four question types

| Type | Ask it | You get back |
|---|---|---|
| `Noul` | a yes/no question | `noul`, the probability the answer is yes |
| `Choice` | pick one of your options | `choice`, `probabilities`, `confidence` |
| `Score` | rate against ordered levels | `score`, `legend`, `probabilities`, `confidence` |
| `Box` | where something is in an image | `top`, `bottom`, `left`, `right`, `confidence` |

A `Noul` carries no confidence, because the probability is the whole answer.

## Images

Pass images in `assets`, keyed by a reference string, and write the reference where
the image belongs: in the state, an

Also filed under Tools & apps

  1. 0616

    Jevstiller: distill Jev calls into a local model

    A self-hosted proxy that trains a local model on Jev's answers. It served 72% of Banking77 locally at 15 ms, with a 2% audit and a bound on disagreement.

    tomerglick57 · Tools & apps · 15 ms local

  2. 0611

    Scruple: code checks for what linters miss

    Semantic-aware linting with System One models: rules you can state in a sentence, checked against your code by Jev.

    @nalexpeae · Tools & apps

  3. 0606

    Algolia-style Postgres search with a Jev reranker

    Typo tolerance, typeahead, barcodes and facet counts in plain Postgres SQL, plus an optional Jev step that asks one question per top-10 result.

    @alex_forman1 · Tools & apps

  4. 0604

    Virtual Closet: outfits from closet videos

    built a virtual closet & outfit generator from raw closet videos. classification + semantic search thanks to jev 🥰. clueless closet dreams finally coming to life

    @maitreemervana · Tools & apps