File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
models/spring-ai-zhipuai/src/main/java/org/springframework/ai/zhipuai Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -297,14 +297,10 @@ public Flux<ChatResponse> stream(Prompt prompt) {
297
297
return this .stream (new Prompt (toolCallConversation , prompt .getOptions ()));
298
298
}
299
299
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 ));
308
304
// @formatter:on
309
305
310
306
return new MessageAggregator ().aggregate (flux , observationContext ::setResponse );
You can’t perform that action at this time.
0 commit comments