From 05c74ff22517cf9803a0c02aa73ba030ae542d35 Mon Sep 17 00:00:00 2001 From: Ido Berkovich Date: Wed, 25 Dec 2024 10:41:27 +0200 Subject: [PATCH] OPIK-610 pr comments --- .../com/comet/opik/domain/llmproviders/LlmProviderFactory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/opik-backend/src/main/java/com/comet/opik/domain/llmproviders/LlmProviderFactory.java b/apps/opik-backend/src/main/java/com/comet/opik/domain/llmproviders/LlmProviderFactory.java index 86c1931c6..34ad3f808 100644 --- a/apps/opik-backend/src/main/java/com/comet/opik/domain/llmproviders/LlmProviderFactory.java +++ b/apps/opik-backend/src/main/java/com/comet/opik/domain/llmproviders/LlmProviderFactory.java @@ -25,8 +25,9 @@ public LlmProviderFactory( public LlmProviderService getService(@NonNull String workspaceId, @NonNull String model) { var llmProvider = getLlmProvider(model); + var apiKey = EncryptionUtils.decrypt(getEncryptedApiKey(workspaceId, llmProvider)); + if (llmProvider == LlmProvider.OPEN_AI) { - var apiKey = EncryptionUtils.decrypt(getEncryptedApiKey(workspaceId, llmProvider)); return new OpenAi(llmProviderClientConfig, apiKey); }