Skip to content

Commit cc3d338

Browse files
mxsl-grmarkpollack
authored andcommitted
optimize: remove useless TODO comment on ZhiPu chat model
1 parent 77586d5 commit cc3d338

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

models/spring-ai-zhipuai/src/main/java/org/springframework/ai/zhipuai/ZhiPuAiChatModel.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -297,14 +297,10 @@ public Flux<ChatResponse> stream(Prompt prompt) {
297297
return this.stream(new Prompt(toolCallConversation, prompt.getOptions()));
298298
}
299299
return Flux.just(response);
300-
}).doOnError(observation::error).doFinally(s -> {
301-
// TODO: Consider a custom ObservationContext and
302-
// include additional metadata
303-
// if (s == SignalType.CANCEL) {
304-
// observationContext.setAborted(true);
305-
// }
306-
observation.stop();
307-
}).contextWrite(ctx -> ctx.put(ObservationThreadLocalAccessor.KEY, observation));
300+
})
301+
.doOnError(observation::error)
302+
.doFinally(s -> observation.stop())
303+
.contextWrite(ctx -> ctx.put(ObservationThreadLocalAccessor.KEY, observation));
308304
// @formatter:on
309305

310306
return new MessageAggregator().aggregate(flux, observationContext::setResponse);

0 commit comments

Comments
 (0)