diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/pom.xml b/yudao-module-ai/yudao-spring-boot-starter-ai/pom.xml index 9a19270dbf..e7a4cf2452 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/pom.xml +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/pom.xml @@ -22,6 +22,11 @@ spring-ai-openai-spring-boot-starter 1.0.3 + + io.springboot.ai + spring-ai-vertex-ai-gemini + 1.0.3 + cn.iocoder.boot diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/enums/AiPlatformEnum.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/enums/AiPlatformEnum.java index fc41069a92..cd70122988 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/enums/AiPlatformEnum.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/enums/AiPlatformEnum.java @@ -21,6 +21,7 @@ public enum AiPlatformEnum { OPEN_AI_DALL("dall", "dall"), MIDJOURNEY("midjourney", "midjourney"), + GEMIR ("gemir ", "gemir "), // google gemir ; diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/factory/AiClientFactoryImpl.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/factory/AiClientFactoryImpl.java index 50d7149607..0f83a99ee5 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/factory/AiClientFactoryImpl.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/factory/AiClientFactoryImpl.java @@ -169,4 +169,15 @@ public class AiClientFactoryImpl implements AiClientFactory { return new QianWenChatClient(qianWenApi); } + + private static VertexAiGeminiChatClient buildGoogleGemir(String key) { + List keys = StrUtil.split(key, '|'); + Assert.equals(keys.size(), 2, "VertexAiGeminiChatClient 的密钥需要 (projectId|location) 格式"); + VertexAI vertexApi = new VertexAI(keys.get(0), keys.get(1)); + return new VertexAiGeminiChatClient(vertexApi, + VertexAiGeminiChatOptions.builder() + .withTemperature(0.4F) + .build()); + } + }