mirror of
				https://github.com/YunaiV/ruoyi-vue-pro.git
				synced 2025-10-30 18:16:57 +08:00 
			
		
		
		
	【增加】增加 google gemini
This commit is contained in:
		| @ -22,6 +22,11 @@ | ||||
|             <artifactId>spring-ai-openai-spring-boot-starter</artifactId> | ||||
|             <version>1.0.3</version> | ||||
|         </dependency> | ||||
|         <dependency> | ||||
|             <groupId>io.springboot.ai</groupId> | ||||
|             <artifactId>spring-ai-vertex-ai-gemini</artifactId> | ||||
|             <version>1.0.3</version> | ||||
|         </dependency> | ||||
|  | ||||
|         <dependency> | ||||
|             <groupId>cn.iocoder.boot</groupId> | ||||
|  | ||||
| @ -21,6 +21,7 @@ public enum AiPlatformEnum { | ||||
|  | ||||
|     OPEN_AI_DALL("dall", "dall"), | ||||
|     MIDJOURNEY("midjourney", "midjourney"), | ||||
|     GEMIR ("gemir ", "gemir "), // google gemir | ||||
|  | ||||
|     ; | ||||
|  | ||||
|  | ||||
| @ -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()); | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 cherishsince
					cherishsince