25 lines
850 B
Java
25 lines
850 B
Java
package com.rj.service;
|
||
|
||
import com.rj.dto.AiQaCustomerAskRequestDto;
|
||
import com.rj.dto.AiQaCustomerAskResponseDto;
|
||
import reactor.core.publisher.Flux;
|
||
|
||
/**
|
||
* AI 问答子表:客户提问并调用大模型的业务
|
||
*/
|
||
public interface IAiQaCustomerAskService {
|
||
|
||
/**
|
||
* 校验入参、拼装 messages、调用本地 OpenAI 兼容接口,返回回答数据。
|
||
*
|
||
* @throws IllegalArgumentException 入参不合法(非受检,调用方需捕获或转为 HTTP 400)
|
||
* @throws Exception HTTP 或解析失败、模型返回错误等
|
||
*/
|
||
AiQaCustomerAskResponseDto askCustomer(AiQaCustomerAskRequestDto request) throws Exception;
|
||
|
||
/**
|
||
* 流式回答:按分片持续返回大模型输出,流结束后落库。
|
||
*/
|
||
Flux<String> askCustomerStream(AiQaCustomerAskRequestDto request);
|
||
}
|