【增加】增加 google gemini

This commit is contained in:
cherishsince
2024-05-24 15:06:36 +08:00
parent 5618313d65
commit 10ca7a93ac
3 changed files with 17 additions and 0 deletions

View File

@ -21,6 +21,7 @@ public enum AiPlatformEnum {
OPEN_AI_DALL("dall", "dall"),
MIDJOURNEY("midjourney", "midjourney"),
GEMIR ("gemir ", "gemir "), // google gemir
;

View File

@ -169,4 +169,15 @@ public class AiClientFactoryImpl implements AiClientFactory {
return new QianWenChatClient(qianWenApi);
}
private static VertexAiGeminiChatClient buildGoogleGemir(String key) {
List<String> 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());
}
}