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.
# 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