feat: ollama流式应答接口实现
This commit is contained in:
26
ai-rag-api/src/main/java/com/storm/dev/api/IAiService.java
Normal file
26
ai-rag-api/src/main/java/com/storm/dev/api/IAiService.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package com.storm.dev.api;
|
||||
|
||||
import org.springframework.ai.chat.ChatResponse;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
/**
|
||||
* @author: lyd
|
||||
* @date: 2025/6/7 22:12
|
||||
*/
|
||||
public interface IAiService {
|
||||
/**
|
||||
* 非流式生成
|
||||
* @param model 模型
|
||||
* @param message 信息
|
||||
* @return
|
||||
*/
|
||||
ChatResponse generate(String model, String message);
|
||||
|
||||
/**
|
||||
* 流式生成
|
||||
* @param model 模型
|
||||
* @param message 信息
|
||||
* @return
|
||||
*/
|
||||
Flux<ChatResponse> generateStream(String model, String message);
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @author: lyd
|
||||
* @date: 2025/6/7 19:12
|
||||
*/
|
||||
*/
|
||||
package com.storm.dev.api;
|
||||
Reference in New Issue
Block a user