Open
Description
The VertexAiGeminiChatModel
does not subscribe on bounded elastic and fail as .block()
gets called in the MCP client implementation.
This has been addressed for few models in this issue with commit.
Can the same be applied to VertexAI as well?
Proposed change:
in the method internalStream
Flux<ChatResponse> chatResponse1 = Flux.fromStream(responseStream.stream())
.switchMap(response2 -> Mono.just(response2).map(response -> {
List<Generation> generations = response.getCandidatesList()
.stream()
.map(this::responseCandidateToGeneration)
.flatMap(List::stream)
.toList();
return new ChatResponse(generations, toChatResponseMetadata(response));
})).subscribeOn(Schedulers.bounderedElastic());