-
Notifications
You must be signed in to change notification settings - Fork 1.5k
When using Chat Memory, if it is in streaming mode, an error "No StreamAdvisors available to execute" will occur. In non - streaming mode, it runs normally. #3344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
org.springframework.ai
spring-ai-bom
1.0.0
pom
import
@resource
|
Thank you, bro. I will use it in MCP. Your approach doesn't have much to do with the current problem. |
Thank you very much. Just like you, I can't make it run properly. Currently, there is an error message: "No StreamAdvisors available to execute". Code: @Bean(name = "openaiChatClientBuilder")
public ChatClient chatClient(OpenAiChatModel openAiChatModel,
@Qualifier("syncMcpToolCallbackProvider") ToolCallbackProvider syncMcpToolCallbackProvider,
ChatMemory chatMemory) {
DefaultChatClientBuilder defaultChatClientBuilder = new DefaultChatClientBuilder(openAiChatModel,
ObservationRegistry.NOOP, (ChatClientObservationConvention) null);
return defaultChatClientBuilder
.defaultToolCallbacks(syncMcpToolCallbackProvider.getToolCallbacks())
.defaultAdvisors(
PromptChatMemoryAdvisor.builder(chatMemory).build())
.build();
} |
Hi @yangbuyiya the issue you reported is actually caused by your test code. In your test code, you first used As a result, after In short, do not subscribe to the same Flux multiple times. You can write it like this instead: ...
chatResponseFlux
.doOnNext(chatResponse -> {
AssistantMessage assistantMessage = chatResponse.getResult().getOutput();
String text = assistantMessage.getText();
System.out.print(text);
})
.doOnError(error -> System.err.println("error: " + error.getMessage()))
.doOnComplete(() -> System.out.println("\n>>> over"))
.blockLast(); |
@yangbuyiya By the way, let me add one more thing. As I mentioned earlier, the message "No StreamAdvisors available to execute" appears because the method Therefore, in conclusion, I don't think this is an issue with Spring AI itself. |
@sunyuhan1998 Thank you so much. I just gave it a try and the streaming output can work properly now. I still have a lot to learn!!!!!!!!! |
Uh oh!
There was an error while loading. Please reload this page.
When using Chat Memory, if it is in streaming mode, an error "No StreamAdvisors available to execute" will occur. In non - streaming mode, it runs normally.
Bug description
When using Chat Memory, if it is in streaming mode, an error "No StreamAdvisors available to execute" will occur. In non - streaming mode, it runs normally.
Environment
Spring AI 1.0.0、JDK17
Build Advisors
Memory storage
Unit testing
Expected behavior
I hope it can support streaming. Currently, the non-streaming mode can run normally.
The text was updated successfully, but these errors were encountered: