mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 23:31:52 +08:00
AI:code review chat 部分的代码(qianwen)
This commit is contained in:
parent
29dc77fc0d
commit
a44628e436
@ -11,6 +11,7 @@ public interface ErrorCodeConstants {
|
||||
|
||||
// ========== 模块 ai 错误码区间 [1-022-000-000 ~ 1-023-000-000) ==========
|
||||
|
||||
// TODO @fansili:1)类注释不太对;2)中英文之间,有个空格;例如说 AI 模型
|
||||
ErrorCode AI_MODULE_NOT_SUPPORTED = new ErrorCode(1_022_000_000, "AI模型暂不支持!");
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.ai.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
// TODO @fansili:1)类注释要加下;2)author 和 time 用 javadoc,@author 和 @since;3)@AllArgsConstructor 使用这个注解,去掉构造方法;4)value 改成 model 字段,然后注释都写下哈;5)message 改成 name,然后注释都写下哈
|
||||
/**
|
||||
* author: fansili
|
||||
* time: 2024/3/4 12:36
|
||||
@ -19,7 +20,9 @@ public enum AiModelEnum {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
// TODO @fan
|
||||
private String value;
|
||||
|
||||
private String message;
|
||||
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ import reactor.core.publisher.Flux;
|
||||
import java.util.Scanner;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
// TODO @fansili:有了 swagger 注释,就不用类注释了
|
||||
/**
|
||||
* AI模块
|
||||
*
|
||||
|
@ -5,6 +5,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
// TODO @fansili 1)swagger 注释不太对;2)有了 swagger 注释,就不用类注释了
|
||||
/**
|
||||
* ai 聊天 req
|
||||
*
|
||||
|
@ -1,4 +1,4 @@
|
||||
# open ai
|
||||
# open ai TODO @fansili??????????????
|
||||
|
||||
# openAI https://openai.com/
|
||||
spring.ai.openai.api-key=${OPEN_AI_KEY}
|
||||
|
@ -9,6 +9,7 @@ import org.springframework.http.HttpStatusCode;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
// TODO @fansili:是不是挪到 api 包里?按照 spring ai 的结构;根目录只放 client 和 options
|
||||
/**
|
||||
* 阿里 通义千问
|
||||
*
|
||||
|
@ -29,7 +29,7 @@ import java.util.stream.Collectors;
|
||||
* time: 2024/3/13 21:06
|
||||
*/
|
||||
@Slf4j
|
||||
public class QianWenChatClient implements ChatClient, StreamingChatClient {
|
||||
public class QianWenChatClient implements ChatClient, StreamingChatClient {
|
||||
|
||||
private QianWenApi qianWenApi;
|
||||
|
||||
@ -44,6 +44,7 @@ public class QianWenChatClient implements ChatClient, StreamingChatClient {
|
||||
this.qianWenOptions = qianWenOptions;
|
||||
}
|
||||
|
||||
// TODO @fansili:看看咋公用出来,允许传入类似异常之类的参数;
|
||||
public final RetryTemplate retryTemplate = RetryTemplate.builder()
|
||||
// 最大重试次数 10
|
||||
.maxAttempts(10)
|
||||
|
@ -1,5 +1,13 @@
|
||||
/**
|
||||
* author: fansili
|
||||
* time: 2024/3/12 20:29
|
||||
*
|
||||
* 1. org.springframework.ai:包括 chat、image、model、parser、util 部分
|
||||
*
|
||||
* 2. yudao.framework.models
|
||||
* \qianwen 通义千问
|
||||
* \yiyan 文心一言
|
||||
* \xinghuo 星火
|
||||
* \midjourney
|
||||
*/
|
||||
package cn.iocoder.yudao.framework.ai;
|
Loading…
Reference in New Issue
Block a user