0367GitHub
jevr
Native R client for typed questions and provider-independent answers through TypeSafe or OpenRouter.
simxnherrera/jevrREADME ↗
- [jevr](#jevr)
- [Installation](#installation)
- [Authentication](#authentication)
- [Basic usage](#basic-usage)
- [Question types](#question-types)
- [Providers](#providers)
- [Versioned specifications and multiple
states](#versioned-specifications-and-multiple-states)
- [Response object](#response-object)
<!-- README.md is generated from README.Rmd. Please edit that file -->
# jevr
<!-- badges: start -->
[](https://github.com/simxnherrera/jevr/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
`jevr` is an R client for [JEV / TypeSafe System
One](https://docs.typesafe.ai/concepts/system-one). It sends a state and
a set of typed questions to a model and returns structured answers that
can be used directly in R.
JEV is designed for structured decisions rather than conversational
chat. The package supports multiple questions in one evaluation,
probabilities, confidence, usage, and provider metadata.
## Installation
Install the development version from GitHub:
``` r
install.packages("pak")
pak::pak("simxnherrera/jevr")
```
Once `jevr` is available on CRAN, the stable version can be installed
with:
``` r
install.packages("jevr")
```
## Authentication
Set the API key for the provider you want to use in your `.Renviron`
file:
``` r
usethis::edit_r_environ()
```
``` text
# Direct TypeSafe requests
TYPESAFE_API_KEY=your_typesafe_key
# OpenRouter requests
OPENROUTER_API_KEY=your_openrouter_key
```
Keys are read when `jev_ask()` is called and are not included in
returned objects.
## Basic usage
Define one or more questions, then pass them together with the state to
`jev_ask()`:
``` r
library(jevr)
questions <- list(
department = jev_choice(
instructions = "Which team should handle this?",
criteria = c(
billing = "Paym