Skip to content

Commit

Permalink
Set default advise stream response mode to on-finish
Browse files Browse the repository at this point in the history
  • Loading branch information
tzolov committed Sep 11, 2024
1 parent 67c55cb commit 0041afa
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ public String getName() {
return this.getClass().getSimpleName();
}

@Override
public StreamResponseMode getStreamResponseMode() {
return StreamResponseMode.AGGREGATE;
}

protected T getChatMemoryStore() {
return this.chatMemoryStore;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ public ChatResponse adviseResponse(ChatResponse response, Map<String, Object> co
return chatResponseBuilder.build();
}

@Override
public StreamResponseMode getStreamResponseMode() {
return StreamResponseMode.ON_FINISH_ELEMENT;
}

protected Filter.Expression doGetFilterExpression(Map<String, Object> context) {

if (!context.containsKey(FILTER_EXPRESSION)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,9 @@ public String toString() {
return SimpleLoggerAdvisor.class.getSimpleName();
}

@Override
public StreamResponseMode getStreamResponseMode() {
return StreamResponseMode.AGGREGATE;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public enum StreamResponseMode {
}

default StreamResponseMode getStreamResponseMode() {
return StreamResponseMode.AGGREGATE;
return StreamResponseMode.ON_FINISH_ELEMENT;
}

/**
Expand Down

0 comments on commit 0041afa

Please sign in to comment.