jichengda
jichengda
我也遇到了同样的问题,如果不使用toos,向AI提问的时候是可以正常流式返回的。如果使用了toos,向AI提问的时候就不可以六十返回了。
@GetMapping(path = "/stream", produces = "text/html;charset=utf-8") public Flux stream(String question, String chatId) { return chatClient.prompt().user(question).stream().content(); // 这样是正常的流式响应 return chatClient.prompt().user(question).tools(new DataTools()).stream().content(); // 这样不是流式响应,阻塞式 }
> > ``` > > @GetMapping(path = "/stream", produces = "text/html;charset=utf-8") > > public Flux stream(String question, String chatId) { > > return chatClient.prompt().user(question).stream().content(); // 这样是正常的流式响应 > > return chatClient.prompt().user(question).tools(new...
> 1、配置文件 spring: ai: openai: base-url: http://192.168.1.123:11434 chat: options: model: qwen2.5:7b-instruct-fp16 stream-usage: true > > ``` > mcp: > client: > type: async > sse: > connections: > mcp-server-chart: >...
> This issue was previously fixed by PR:[#3372](https://github.com/spring-projects/spring-ai/pull/3372), perhaps you can upgrade to version 1.1.0-SNAPSHOT first. Thank you, indeed. After I changed the version number, the program started working properly.
I also encountered this problem, but I solved it. It's caused by apiKey, if you don't need apiKey, set EMPTY ` OpenAiApi api = OpenAiApi.builder() .apiKey("EMPTY") .baseUrl("http://192.168.0.0.1:8001/") .build();`
> We are now using Spring AI to call VLLM through the API of OpenAI Starter, which is a compromise. If Spring AI could provide a pluggable vllm starter like...
> 也可以自定义获取思考内容 没看懂你说的,我是要获取Advisors中插入数据库的id。用memory消息会记录到数据库,我想获取到消息存储到数据中的id,做后续的操作。