Rather than requiring Java callers to deal with Scala's Either, Option, or Left/Right, this class surfaces a familiar API modelled after java.util.Optional and CompletableFuture.
LlmResult<String> result = client.complete("What is 2+2?");
result.ifSuccess(System.out::println)
.ifFailure(e -> System.err.println(e.getMessage()));
Intended for reference types only (String, Completion, ...), which is what every Java-facing API here returns. If A were ever a primitive mapping (int, boolean), the failure case would yield 0/false instead of null, so prefer toOptional or isSuccess there.