this looks good
This commit is contained in:
parent
307e2f7c1a
commit
7a38fd5762
3 changed files with 4 additions and 27 deletions
|
@ -58,7 +58,7 @@ class ExampleSource implements ChatSource {
|
|||
|
||||
return new ChatResponse() {
|
||||
@Override
|
||||
boolean isStreaming() {
|
||||
boolean streaming() {
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ public interface ChatResponse {
|
|||
*
|
||||
* @return is this response streaming
|
||||
*/
|
||||
boolean isStreaming();
|
||||
boolean streaming();
|
||||
|
||||
/**
|
||||
* if streamed, text token by token as it goes (or other splitting depending on the source)
|
||||
|
|
|
@ -6,29 +6,6 @@ import eu.m724.chat.ChatMessage;
|
|||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
public class SimpleChatResponse implements ChatResponse {
|
||||
public final boolean streaming;
|
||||
public final LinkedBlockingQueue<ChatEvent> eventQueue;
|
||||
public final CompletableFuture<ChatMessage> message;
|
||||
|
||||
public SimpleChatResponse(boolean streaming, LinkedBlockingQueue<ChatEvent> eventQueue, CompletableFuture<ChatMessage> message) {
|
||||
this.streaming = streaming;
|
||||
this.eventQueue = eventQueue;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStreaming() {
|
||||
return streaming;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinkedBlockingQueue<ChatEvent> eventQueue() {
|
||||
return eventQueue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<ChatMessage> message() {
|
||||
return message;
|
||||
}
|
||||
public record SimpleChatResponse(boolean streaming, LinkedBlockingQueue<ChatEvent> eventQueue,
|
||||
CompletableFuture<ChatMessage> message) implements ChatResponse {
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue