package eu.m724.responsesource; import eu.m724.chat.ChatMessage; import java.util.concurrent.CompletableFuture; public interface ChatResponse { /** * is this response streaming * @return is this response streaming */ boolean isStreaming(); /** * if streamed, text token by token as it goes (or other splitting depending on the source) * if not, the {@link CompletableFuture} returns just the whole response after it's ready * @return yeah */ CompletableFuture text(); // TODO completablefuture is not correct here also fix the doc /** * gets the resulting {@link ChatMessage} * TODO I think it should be available after streaming is done so maybe wrap this in {@link CompletableFuture} * @return the resulting {@link ChatMessage} */ ChatMessage message(); }