Browse Source
AI rule node: replace Anthropic with Mistral AI
pull/13371/head
Dmytro Skarzhynets
1 year ago
No known key found for this signature in database
GPG Key ID: 2B51652F224037DF
2 changed files with
4 additions and
4 deletions
-
application/pom.xml
-
application/src/main/java/org/thingsboard/server/service/ai/AiServiceImpl.java
|
|
|
@ -383,11 +383,11 @@ |
|
|
|
</dependency> |
|
|
|
<dependency> |
|
|
|
<groupId>dev.langchain4j</groupId> |
|
|
|
<artifactId>langchain4j-anthropic</artifactId> |
|
|
|
<artifactId>langchain4j-google-ai-gemini</artifactId> |
|
|
|
</dependency> |
|
|
|
<dependency> |
|
|
|
<groupId>dev.langchain4j</groupId> |
|
|
|
<artifactId>langchain4j-google-ai-gemini</artifactId> |
|
|
|
<artifactId>langchain4j-mistral-ai</artifactId> |
|
|
|
</dependency> |
|
|
|
</dependencies> |
|
|
|
|
|
|
|
|
|
|
|
@ -15,9 +15,9 @@ |
|
|
|
*/ |
|
|
|
package org.thingsboard.server.service.ai; |
|
|
|
|
|
|
|
import dev.langchain4j.model.anthropic.AnthropicChatModel; |
|
|
|
import dev.langchain4j.model.chat.ChatModel; |
|
|
|
import dev.langchain4j.model.googleai.GoogleAiGeminiChatModel; |
|
|
|
import dev.langchain4j.model.mistralai.MistralAiChatModel; |
|
|
|
import dev.langchain4j.model.openai.OpenAiChatModel; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
@ -49,7 +49,7 @@ class AiServiceImpl implements RuleEngineAiService { |
|
|
|
.apiKey(aiSettings.getApiKey()) |
|
|
|
.modelName(aiSettings.getModel()) |
|
|
|
.build(); |
|
|
|
case "anthropic" -> AnthropicChatModel.builder() |
|
|
|
case "mistral-ai" -> MistralAiChatModel.builder() |
|
|
|
.apiKey(aiSettings.getApiKey()) |
|
|
|
.modelName(aiSettings.getModel()) |
|
|
|
.build(); |
|
|
|
|