shipwithjev

Catalog / Tools & apps

0041GitHub

jev-spring-boot-starter

Jev as a Spring Boot 4 starter, over Spring MVC and RestClient.

Dan Vega’s starter adds the configuration, the client and the typed calls, so a Spring application can ask Jev a question without any glue code.

danvega/jev-spring-boot-starterREADME ↗
# Jev Spring Boot Starter

Ask typed questions with [TypeSafe Jev](https://docs.typesafe.ai/introduction) from a Spring MVC application.
Add one dependency, set an API key, and inject `JevClient`.

**Spring Boot 4.0+ · Java 17+ · Spring MVC · RestClient · Jackson 3**

This is an independent community project. Version `0.1.0-SNAPSHOT` is a local development version and is not published to Maven Central.

## Get started

First, build and install the starter from this repository:

```sh
./mvnw clean install
```

Add it to an existing Spring Boot 4 MVC application:

```xml
<dependency>
    <groupId>dev.danvega</groupId>
    <artifactId>jev-spring-boot-starter</artifactId>
    <version>0.1.0-SNAPSHOT</version>
</dependency>
```

Your application supplies `spring-boot-starter-webmvc`. The Jev starter supplies
`spring-boot-starter-restclient`; it does not start a web server itself.

Set the key:

```sh
export TYPESAFE_API_KEY=your-key
```

Inject the client into a service:

```java
import dev.danvega.jev.JevClient;
import dev.danvega.jev.Question;
import org.springframework.stereotype.Service;
import java.util.Map;

@Service
public class TicketService {
    private final JevClient jev;

    public TicketService(JevClient jev) {
        this.jev = jev;
    }

    public String route(String message) {
        var response = jev.evaluate(message, Map.of(
                "team", Question.choice("Which team should handle this?",
                        "billing", "integrations", "support")));

        return response.choice("team").choice();
    }
}
```

No enable annotation or component scanning configuration is needed. The starter activates
in servlet applications, supplies one `JevClient`, and backs off when you provide your own.
It makes no HTTP calls during startup. A missing 

Also filed under Tools & apps

  1. 0573

    Support chat: agent offered a human escalation path

    A frustrated customer hits a bot loop twice; the judge checks whether a human handoff was offered.

    everyai-com · Tools & apps

  2. 0572

    Subscription cancel: effective date is explicit

    An agent cancels a subscription; the judge checks the exact date the cancellation takes effect.

    everyai-com · Tools & apps

  3. 0571

    Sales quote: numbers match the official price list

    An agent quotes $29/seat against a price list; the judge checks the quote matches exactly.

    everyai-com · Tools & apps

  4. 0570

    Refund chat: agent stated the amount before issuing it

    A support agent issues a $42.50 refund; the judge checks the exact amount was stated before the refund was confirmed.

    everyai-com · Tools & apps