refactor(common): 简化 ErrorCode 枚举并升级模型配置
- 使用 Lombok @Getter 移除手写 getter,精简 5 行代码 - 将 embedding 模型从 0.6B 升级为 8B 提升效果 - 切换 OpenRouter 网关地址到 Cloudflare AI Gateway 加速访问
This commit is contained in:
@@ -1,10 +1,13 @@
|
|||||||
package com.yolo.keyborad.common;
|
package com.yolo.keyborad.common;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 错误码
|
* 错误码
|
||||||
*
|
*
|
||||||
* @author yupi
|
* @author yupi
|
||||||
*/
|
*/
|
||||||
|
@Getter
|
||||||
public enum ErrorCode {
|
public enum ErrorCode {
|
||||||
|
|
||||||
SUCCESS(0, "ok"),
|
SUCCESS(0, "ok"),
|
||||||
@@ -31,12 +34,4 @@ public enum ErrorCode {
|
|||||||
this.message = message;
|
this.message = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCode() {
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMessage() {
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class LLMConfig {
|
|||||||
this.openAiApi(),
|
this.openAiApi(),
|
||||||
MetadataMode.EMBED,
|
MetadataMode.EMBED,
|
||||||
OpenAiEmbeddingOptions.builder()
|
OpenAiEmbeddingOptions.builder()
|
||||||
.model("qwen/qwen3-embedding-0.6b")
|
.model("qwen/qwen3-embedding-8b")
|
||||||
.dimensions(2048)
|
.dimensions(2048)
|
||||||
.user("user-6")
|
.user("user-6")
|
||||||
.build(),
|
.build(),
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ spring:
|
|||||||
ai:
|
ai:
|
||||||
openai:
|
openai:
|
||||||
api-key: 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
|
api-key: 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
|
||||||
base-url: https://openrouter.ai/api/
|
base-url: https://gateway.ai.cloudflare.com/v1/b632a61caa85401f63c9b32eef3a74c8/aigetway/openrouter
|
||||||
chat:
|
chat:
|
||||||
options:
|
options:
|
||||||
model: google/gemini-2.5-flash-lite
|
model: google/gemini-2.5-flash-lite
|
||||||
|
|||||||
Reference in New Issue
Block a user