流式输出,秒级,效果非常棒

This commit is contained in:
2026-03-31 21:06:59 +08:00
parent 279c28b412
commit fe7db4d4cf
3 changed files with 196 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ package com.rj.service;
import com.rj.dto.AiQaCustomerAskRequestDto;
import com.rj.dto.AiQaCustomerAskResponseDto;
import reactor.core.publisher.Flux;
/**
* AI 问答子表:客户提问并调用大模型的业务
@@ -15,4 +16,9 @@ public interface IAiQaCustomerAskService {
* @throws Exception HTTP 或解析失败、模型返回错误等
*/
AiQaCustomerAskResponseDto askCustomer(AiQaCustomerAskRequestDto request) throws Exception;
/**
* 流式回答:按分片持续返回大模型输出,流结束后落库。
*/
Flux<String> askCustomerStream(AiQaCustomerAskRequestDto request);
}