We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4fd15b1 commit 7bfe312Copy full SHA for 7bfe312
spring-ai-core/src/main/java/org/springframework/ai/chat/StreamingChatClient.java
@@ -23,6 +23,13 @@
23
@FunctionalInterface
24
public interface StreamingChatClient extends StreamingModelClient<Prompt, ChatResponse> {
25
26
+ default Flux<String> stream(String message) {
27
+ Prompt prompt = new Prompt(message);
28
+ return stream(prompt).map(response -> (response.getResult() == null || response.getResult().getOutput() == null
29
+ || response.getResult().getOutput().getContent() == null) ? ""
30
+ : response.getResult().getOutput().getContent());
31
+ }
32
+
33
@Override
34
Flux<ChatResponse> stream(Prompt prompt);
35
0 commit comments