From 9065444ed15148bdcd0484ff52520502f41da67d Mon Sep 17 00:00:00 2001 From: Victor Alfaro Date: Thu, 1 Aug 2024 11:21:48 -0600 Subject: [PATCH] #29284: apllying feedback and fixing dirty models from being updated. --- core-web/yarn.lock | 36 +---------------- .../java/com/dotcms/ai/api/AIClientAPI.java | 5 ++- .../main/java/com/dotcms/ai/api/AIModels.java | 2 +- .../main/java/com/dotcms/ai/api/AIProxy.java | 17 ++++++++ .../java/com/dotcms/ai/api/AIServices.java | 12 ++++-- .../com/dotcms/ai/api/CompletionsAPI.java | 2 +- .../com/dotcms/ai/api/CompletionsAPIImpl.java | 2 +- .../com/dotcms/ai/api/EmbeddingsAPIImpl.java | 4 +- .../com/dotcms/ai/api/EmbeddingsRunner.java | 2 +- .../dotcms/ai/{config => app}/AppConfig.java | 5 +-- .../java/com/dotcms/ai/app/ConfigService.java | 1 - .../com/dotcms/ai/config/ProviderConfig.java | 39 ------------------- .../ai/listener/EmbeddingContentListener.java | 2 +- .../ai/model/request/AIJSONObjectRequest.java | 2 +- .../dotcms/ai/model/request/AIRequest.java | 2 +- .../dotcms/ai/rest/CompletionsResource.java | 2 +- .../com/dotcms/ai/rest/ImageResource.java | 2 +- .../java/com/dotcms/ai/rest/TextResource.java | 2 +- .../dotcms/ai/rest/forms/CompletionsForm.java | 2 +- .../dotcms/ai/rest/forms/EmbeddingsForm.java | 2 +- .../ai/service/OpenAIChatServiceImpl.java | 2 +- .../ai/service/OpenAIImageServiceImpl.java | 2 +- .../dotcms/ai/util/ContentToStringUtil.java | 2 +- .../com/dotcms/ai/util/OpenAIRequest.java | 2 +- .../com/dotcms/ai/viewtool/AIViewTool.java | 2 +- .../dotcms/ai/viewtool/CompletionsTool.java | 2 +- .../dotcms/ai/viewtool/EmbeddingsTool.java | 2 +- .../ai/service/OpenAIChatServiceImplTest.java | 2 +- .../service/OpenAIImageServiceImplTest.java | 2 +- .../src/test/java/com/dotcms/ai/AiTest.java | 2 +- .../dotcms/ai/viewtool/AIViewToolTest.java | 2 +- .../ai/viewtool/CompletionsToolTest.java | 2 +- .../ai/viewtool/EmbeddingsToolTest.java | 2 +- 33 files changed, 59 insertions(+), 110 deletions(-) create mode 100644 dotCMS/src/main/java/com/dotcms/ai/api/AIProxy.java rename dotCMS/src/main/java/com/dotcms/ai/{config => app}/AppConfig.java (98%) delete mode 100644 dotCMS/src/main/java/com/dotcms/ai/config/ProviderConfig.java diff --git a/core-web/yarn.lock b/core-web/yarn.lock index fb9eb00b9e27..e39f94ed7622 100644 --- a/core-web/yarn.lock +++ b/core-web/yarn.lock @@ -11057,7 +11057,7 @@ debug@^3.1.0, debug@^3.2.7: dependencies: ms "^2.1.1" -debuglog@*, debuglog@^1.0.1: +debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" integrity sha512-syBZ+rnAK3EgMsH2aYEOLUW7mZSY9Gb+0wUMCFsZvcmiz+HigA0LOcq/HoQqVuGG+EKykunc7QG2bzrponfaSw== @@ -14187,7 +14187,7 @@ import-local@^3.0.2: pkg-dir "^4.2.0" resolve-cwd "^3.0.0" -imurmurhash@*, imurmurhash@^0.1.4: +imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== @@ -16287,11 +16287,6 @@ lodash-es@^4.17.21: resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee" integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw== -lodash._baseindexof@*: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz#fe52b53a1c6761e42618d654e4a25789ed61822c" - integrity sha512-bSYo8Pc/f0qAkr8fPJydpJjtrHiSynYfYBjtANIgXv5xEf1WlTC63dIDlgu0s9dmTvzRu1+JJTxcIAHe+sH0FQ== - lodash._baseuniq@~4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8" @@ -16300,33 +16295,11 @@ lodash._baseuniq@~4.6.0: lodash._createset "~4.0.0" lodash._root "~3.0.0" -lodash._bindcallback@*: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e" - integrity sha512-2wlI0JRAGX8WEf4Gm1p/mv/SZ+jLijpj0jyaE/AXeuQphzCgD8ZQW4oSpoN8JAopujOFGU3KMuq7qfHBWlGpjQ== - -lodash._cacheindexof@*: - version "3.0.2" - resolved "https://registry.yarnpkg.com/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz#3dc69ac82498d2ee5e3ce56091bafd2adc7bde92" - integrity sha512-S8dUjWr7SUT/X6TBIQ/OYoCHo1Stu1ZRy6uMUSKqzFnZp5G5RyQizSm6kvxD2Ewyy6AVfMg4AToeZzKfF99T5w== - -lodash._createcache@*: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash._createcache/-/lodash._createcache-3.1.2.tgz#56d6a064017625e79ebca6b8018e17440bdcf093" - integrity sha512-ev5SP+iFpZOugyab/DEUQxUeZP5qyciVTlgQ1f4Vlw7VUcCD8fVnyIqVUEIaoFH9zjAqdgi69KiofzvVmda/ZQ== - dependencies: - lodash._getnative "^3.0.0" - lodash._createset@~4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26" integrity sha512-GTkC6YMprrJZCYU3zcqZj+jkXkrXzq3IPBcF/fIPpNEAB4hZEtXU8zp/RwKOvZl43NUmwDbyRk3+ZTbeRdEBXA== -lodash._getnative@*, lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - integrity sha512-RrL9VxMEPyDMHOd9uFbvMe8X55X16/cGM5IgOKgRElQZutpX89iS6vwl64duTV1/16w5JY7tuFNXqoekmh1EmA== - lodash._root@~3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" @@ -16402,11 +16375,6 @@ lodash.once@^4.0.0, lodash.once@^4.1.1: resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" integrity sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg== -lodash.restparam@*: - version "3.6.1" - resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" - integrity sha512-L4/arjjuq4noiUJpt3yS6KIKDtJwNe2fIYgMqyYYKoeIfV1iEqvPwhCx23o+R9dzouGihDAPN1dTIRWa7zk8tw== - lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" diff --git a/dotCMS/src/main/java/com/dotcms/ai/api/AIClientAPI.java b/dotCMS/src/main/java/com/dotcms/ai/api/AIClientAPI.java index 3529af1486bd..16faa8fed54e 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/api/AIClientAPI.java +++ b/dotCMS/src/main/java/com/dotcms/ai/api/AIClientAPI.java @@ -3,11 +3,12 @@ import com.dotcms.ai.model.request.AIRequest; import java.io.OutputStream; +import java.io.Serializable; public interface AIClientAPI { - void sendRequest(final AIRequest request, final OutputStream output); + void sendRequest(final AIRequest request, final OutputStream output); - void sendRequest(final AIRequest request); + void sendRequest(final AIRequest request); } diff --git a/dotCMS/src/main/java/com/dotcms/ai/api/AIModels.java b/dotCMS/src/main/java/com/dotcms/ai/api/AIModels.java index 856f7b63f6a7..e8aaf0d4b811 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/api/AIModels.java +++ b/dotCMS/src/main/java/com/dotcms/ai/api/AIModels.java @@ -1,7 +1,7 @@ package com.dotcms.ai.api; import com.dotcms.ai.app.AIModelType; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotcms.ai.app.ConfigService; import com.dotcms.ai.model.AIModel; import com.dotcms.ai.model.OpenAIModel; diff --git a/dotCMS/src/main/java/com/dotcms/ai/api/AIProxy.java b/dotCMS/src/main/java/com/dotcms/ai/api/AIProxy.java new file mode 100644 index 000000000000..180fcb348ec9 --- /dev/null +++ b/dotCMS/src/main/java/com/dotcms/ai/api/AIProxy.java @@ -0,0 +1,17 @@ +package com.dotcms.ai.api; + +import com.dotcms.ai.model.AIProvider; +import com.dotmarketing.util.Logger; + +public class AIProxy { + + public void attemptToConsumeAI(final AIProvider provider) { + if (!provider.isEnabled()) { + Logger.debug(this, "Provider " + provider.getProvider() + " is not enabled."); + return; + } + + + } + +} diff --git a/dotCMS/src/main/java/com/dotcms/ai/api/AIServices.java b/dotCMS/src/main/java/com/dotcms/ai/api/AIServices.java index ba5dd7203773..bc732b1d2fed 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/api/AIServices.java +++ b/dotCMS/src/main/java/com/dotcms/ai/api/AIServices.java @@ -2,20 +2,26 @@ import com.dotcms.ai.model.AIProvider; +import java.util.ArrayList; import java.util.List; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; +import java.util.stream.Collectors; public class AIServices { - private final ConcurrentMap> clients = new ConcurrentHashMap(); + private final ConcurrentMap> providerClients = new ConcurrentHashMap<>(); public List getProviders() { - return List.of(); + return new ArrayList<>(providerClients.keySet()); } public List getClients(final List providers) { - return List.of(); + return providers.stream() + .flatMap(provider -> providerClients.get(provider).stream()) + .collect(Collectors.toList()); } + + } diff --git a/dotCMS/src/main/java/com/dotcms/ai/api/CompletionsAPI.java b/dotCMS/src/main/java/com/dotcms/ai/api/CompletionsAPI.java index 02d5571f97a4..244850408959 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/api/CompletionsAPI.java +++ b/dotCMS/src/main/java/com/dotcms/ai/api/CompletionsAPI.java @@ -1,6 +1,6 @@ package com.dotcms.ai.api; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotcms.ai.rest.forms.CompletionsForm; import com.dotmarketing.util.json.JSONObject; import io.vavr.Lazy; diff --git a/dotCMS/src/main/java/com/dotcms/ai/api/CompletionsAPIImpl.java b/dotCMS/src/main/java/com/dotcms/ai/api/CompletionsAPIImpl.java index 2ab89c84d443..bd9e70941596 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/api/CompletionsAPIImpl.java +++ b/dotCMS/src/main/java/com/dotcms/ai/api/CompletionsAPIImpl.java @@ -2,7 +2,7 @@ import com.dotcms.ai.AiKeys; import com.dotcms.ai.model.AIModel; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotcms.ai.app.AppKeys; import com.dotcms.ai.app.ConfigService; import com.dotcms.ai.db.EmbeddingsDTO; diff --git a/dotCMS/src/main/java/com/dotcms/ai/api/EmbeddingsAPIImpl.java b/dotCMS/src/main/java/com/dotcms/ai/api/EmbeddingsAPIImpl.java index cfb0dd1591a3..7ed20b93b45a 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/api/EmbeddingsAPIImpl.java +++ b/dotCMS/src/main/java/com/dotcms/ai/api/EmbeddingsAPIImpl.java @@ -1,7 +1,7 @@ package com.dotcms.ai.api; import com.dotcms.ai.AiKeys; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotcms.ai.app.AppKeys; import com.dotcms.ai.app.ConfigService; import com.dotcms.ai.db.EmbeddingsDTO; @@ -54,7 +54,7 @@ import java.util.Optional; import java.util.stream.Collectors; -import static com.dotcms.ai.config.AppConfig.debugLogger; +import static com.dotcms.ai.app.AppConfig.debugLogger; import static com.liferay.util.StringPool.BLANK; /** diff --git a/dotCMS/src/main/java/com/dotcms/ai/api/EmbeddingsRunner.java b/dotCMS/src/main/java/com/dotcms/ai/api/EmbeddingsRunner.java index f543357a44f9..6f352c67ccd4 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/api/EmbeddingsRunner.java +++ b/dotCMS/src/main/java/com/dotcms/ai/api/EmbeddingsRunner.java @@ -16,7 +16,7 @@ import java.util.List; import java.util.Locale; -import static com.dotcms.ai.config.AppConfig.debugLogger; +import static com.dotcms.ai.app.AppConfig.debugLogger; import static com.liferay.util.StringPool.SPACE; /** diff --git a/dotCMS/src/main/java/com/dotcms/ai/config/AppConfig.java b/dotCMS/src/main/java/com/dotcms/ai/app/AppConfig.java similarity index 98% rename from dotCMS/src/main/java/com/dotcms/ai/config/AppConfig.java rename to dotCMS/src/main/java/com/dotcms/ai/app/AppConfig.java index 49542fc8c036..cb4d4364d98d 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/config/AppConfig.java +++ b/dotCMS/src/main/java/com/dotcms/ai/app/AppConfig.java @@ -1,9 +1,6 @@ -package com.dotcms.ai.config; +package com.dotcms.ai.app; import com.dotcms.ai.api.AIModels; -import com.dotcms.ai.app.AIModelType; -import com.dotcms.ai.app.AppKeys; -import com.dotcms.ai.app.ConfigService; import com.dotcms.ai.model.AIModel; import com.dotcms.ai.util.AIAppUtil; import com.dotcms.security.apps.Secret; diff --git a/dotCMS/src/main/java/com/dotcms/ai/app/ConfigService.java b/dotCMS/src/main/java/com/dotcms/ai/app/ConfigService.java index 7c47dc0f22ba..ca1e9d7eb91c 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/app/ConfigService.java +++ b/dotCMS/src/main/java/com/dotcms/ai/app/ConfigService.java @@ -1,6 +1,5 @@ package com.dotcms.ai.app; -import com.dotcms.ai.config.AppConfig; import com.dotcms.api.web.HttpServletRequestThreadLocal; import com.dotcms.security.apps.AppSecrets; import com.dotmarketing.beans.Host; diff --git a/dotCMS/src/main/java/com/dotcms/ai/config/ProviderConfig.java b/dotCMS/src/main/java/com/dotcms/ai/config/ProviderConfig.java deleted file mode 100644 index c0f8d8cf3506..000000000000 --- a/dotCMS/src/main/java/com/dotcms/ai/config/ProviderConfig.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.dotcms.ai.config; - -import com.dotcms.ai.model.AIProvider; - -import java.util.Objects; - -public class ProviderConfig { - - private final AIProvider provider; - - public ProviderConfig(final AIProvider provider) { - this.provider = provider; - } - - public AIProvider getProvider() { - return provider; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - ProviderConfig that = (ProviderConfig) o; - return provider == that.provider; - } - - @Override - public int hashCode() { - return Objects.hashCode(provider); - } - - @Override - public String toString() { - return "ProviderConfig{" + - "provider=" + provider + - '}'; - } - -} diff --git a/dotCMS/src/main/java/com/dotcms/ai/listener/EmbeddingContentListener.java b/dotCMS/src/main/java/com/dotcms/ai/listener/EmbeddingContentListener.java index 8493803e5596..24dbbf1072f6 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/listener/EmbeddingContentListener.java +++ b/dotCMS/src/main/java/com/dotcms/ai/listener/EmbeddingContentListener.java @@ -1,7 +1,7 @@ package com.dotcms.ai.listener; import com.dotcms.ai.api.EmbeddingsAPI; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotcms.ai.app.AppKeys; import com.dotcms.ai.app.ConfigService; import com.dotcms.ai.db.EmbeddingsDTO; diff --git a/dotCMS/src/main/java/com/dotcms/ai/model/request/AIJSONObjectRequest.java b/dotCMS/src/main/java/com/dotcms/ai/model/request/AIJSONObjectRequest.java index 1436fedbf631..f6a03288dd08 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/model/request/AIJSONObjectRequest.java +++ b/dotCMS/src/main/java/com/dotcms/ai/model/request/AIJSONObjectRequest.java @@ -1,6 +1,6 @@ package com.dotcms.ai.model.request; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotmarketing.util.json.JSONObject; public class AIJSONObjectRequest extends AIRequest { diff --git a/dotCMS/src/main/java/com/dotcms/ai/model/request/AIRequest.java b/dotCMS/src/main/java/com/dotcms/ai/model/request/AIRequest.java index d636a35819e5..efc936729ce8 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/model/request/AIRequest.java +++ b/dotCMS/src/main/java/com/dotcms/ai/model/request/AIRequest.java @@ -1,6 +1,6 @@ package com.dotcms.ai.model.request; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import java.io.Serializable; diff --git a/dotCMS/src/main/java/com/dotcms/ai/rest/CompletionsResource.java b/dotCMS/src/main/java/com/dotcms/ai/rest/CompletionsResource.java index 55a963e714ce..b00f4ddab08b 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/rest/CompletionsResource.java +++ b/dotCMS/src/main/java/com/dotcms/ai/rest/CompletionsResource.java @@ -3,7 +3,7 @@ import com.dotcms.ai.AiKeys; import com.dotcms.ai.api.CompletionsAPI; import com.dotcms.ai.api.AIModels; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotcms.ai.app.AppKeys; import com.dotcms.ai.app.ConfigService; import com.dotcms.ai.rest.forms.CompletionsForm; diff --git a/dotCMS/src/main/java/com/dotcms/ai/rest/ImageResource.java b/dotCMS/src/main/java/com/dotcms/ai/rest/ImageResource.java index c01e6b295391..21903b41e291 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/rest/ImageResource.java +++ b/dotCMS/src/main/java/com/dotcms/ai/rest/ImageResource.java @@ -2,7 +2,7 @@ import com.dotcms.ai.AiKeys; import com.dotcms.ai.Marshaller; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotcms.ai.app.ConfigService; import com.dotcms.ai.model.AIImageRequestDTO; import com.dotcms.ai.service.OpenAIImageService; diff --git a/dotCMS/src/main/java/com/dotcms/ai/rest/TextResource.java b/dotCMS/src/main/java/com/dotcms/ai/rest/TextResource.java index eb9786d9a943..28b21c5dfef8 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/rest/TextResource.java +++ b/dotCMS/src/main/java/com/dotcms/ai/rest/TextResource.java @@ -2,7 +2,7 @@ import com.dotcms.ai.AiKeys; import com.dotcms.ai.api.CompletionsAPI; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotcms.ai.app.ConfigService; import com.dotcms.ai.rest.forms.CompletionsForm; import com.dotcms.rest.WebResource; diff --git a/dotCMS/src/main/java/com/dotcms/ai/rest/forms/CompletionsForm.java b/dotCMS/src/main/java/com/dotcms/ai/rest/forms/CompletionsForm.java index e9c9fbe41110..a6bbbbeeec81 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/rest/forms/CompletionsForm.java +++ b/dotCMS/src/main/java/com/dotcms/ai/rest/forms/CompletionsForm.java @@ -1,6 +1,6 @@ package com.dotcms.ai.rest.forms; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotcms.ai.app.AppKeys; import com.dotcms.ai.app.ConfigService; import com.dotmarketing.business.APILocator; diff --git a/dotCMS/src/main/java/com/dotcms/ai/rest/forms/EmbeddingsForm.java b/dotCMS/src/main/java/com/dotcms/ai/rest/forms/EmbeddingsForm.java index 8d3ef553808a..dbc062c8f086 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/rest/forms/EmbeddingsForm.java +++ b/dotCMS/src/main/java/com/dotcms/ai/rest/forms/EmbeddingsForm.java @@ -1,6 +1,6 @@ package com.dotcms.ai.rest.forms; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotcms.ai.app.ConfigService; import com.dotmarketing.business.APILocator; import com.dotmarketing.util.UtilMethods; diff --git a/dotCMS/src/main/java/com/dotcms/ai/service/OpenAIChatServiceImpl.java b/dotCMS/src/main/java/com/dotcms/ai/service/OpenAIChatServiceImpl.java index 04588f1b62a8..08edb4d5d691 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/service/OpenAIChatServiceImpl.java +++ b/dotCMS/src/main/java/com/dotcms/ai/service/OpenAIChatServiceImpl.java @@ -1,7 +1,7 @@ package com.dotcms.ai.service; import com.dotcms.ai.AiKeys; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotcms.ai.app.AppKeys; import com.dotcms.ai.util.OpenAIRequest; import com.dotmarketing.util.UtilMethods; diff --git a/dotCMS/src/main/java/com/dotcms/ai/service/OpenAIImageServiceImpl.java b/dotCMS/src/main/java/com/dotcms/ai/service/OpenAIImageServiceImpl.java index aa4beea14b68..57b571dc140b 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/service/OpenAIImageServiceImpl.java +++ b/dotCMS/src/main/java/com/dotcms/ai/service/OpenAIImageServiceImpl.java @@ -1,7 +1,7 @@ package com.dotcms.ai.service; import com.dotcms.ai.AiKeys; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotcms.ai.model.AIImageRequestDTO; import com.dotcms.ai.util.OpenAIRequest; import com.dotcms.ai.util.OpenAiRequestUtil; diff --git a/dotCMS/src/main/java/com/dotcms/ai/util/ContentToStringUtil.java b/dotCMS/src/main/java/com/dotcms/ai/util/ContentToStringUtil.java index 40d932219d3f..380f64122769 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/util/ContentToStringUtil.java +++ b/dotCMS/src/main/java/com/dotcms/ai/util/ContentToStringUtil.java @@ -40,7 +40,7 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; -import static com.dotcms.ai.config.AppConfig.debugLogger; +import static com.dotcms.ai.app.AppConfig.debugLogger; import static com.liferay.util.StringPool.BLANK; import static com.liferay.util.StringPool.SPACE; diff --git a/dotCMS/src/main/java/com/dotcms/ai/util/OpenAIRequest.java b/dotCMS/src/main/java/com/dotcms/ai/util/OpenAIRequest.java index 924229fba65a..e387127b081c 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/util/OpenAIRequest.java +++ b/dotCMS/src/main/java/com/dotcms/ai/util/OpenAIRequest.java @@ -2,7 +2,7 @@ import com.dotcms.ai.AiKeys; import com.dotcms.ai.model.AIModel; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotcms.ai.app.AppKeys; import com.dotcms.ai.app.ConfigService; import com.dotmarketing.exception.DotRuntimeException; diff --git a/dotCMS/src/main/java/com/dotcms/ai/viewtool/AIViewTool.java b/dotCMS/src/main/java/com/dotcms/ai/viewtool/AIViewTool.java index bc9ebd8eecbd..a33483840625 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/viewtool/AIViewTool.java +++ b/dotCMS/src/main/java/com/dotcms/ai/viewtool/AIViewTool.java @@ -1,7 +1,7 @@ package com.dotcms.ai.viewtool; import com.dotcms.ai.AiKeys; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotcms.ai.app.ConfigService; import com.dotcms.ai.service.OpenAIChatService; import com.dotcms.ai.service.OpenAIChatServiceImpl; diff --git a/dotCMS/src/main/java/com/dotcms/ai/viewtool/CompletionsTool.java b/dotCMS/src/main/java/com/dotcms/ai/viewtool/CompletionsTool.java index e39953a84cf9..03f73a37a8ec 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/viewtool/CompletionsTool.java +++ b/dotCMS/src/main/java/com/dotcms/ai/viewtool/CompletionsTool.java @@ -1,7 +1,7 @@ package com.dotcms.ai.viewtool; import com.dotcms.ai.api.CompletionsAPI; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotcms.ai.app.AppKeys; import com.dotcms.ai.app.ConfigService; import com.dotcms.ai.rest.forms.CompletionsForm; diff --git a/dotCMS/src/main/java/com/dotcms/ai/viewtool/EmbeddingsTool.java b/dotCMS/src/main/java/com/dotcms/ai/viewtool/EmbeddingsTool.java index 1a17d8bf184a..4411ca1cd0fd 100644 --- a/dotCMS/src/main/java/com/dotcms/ai/viewtool/EmbeddingsTool.java +++ b/dotCMS/src/main/java/com/dotcms/ai/viewtool/EmbeddingsTool.java @@ -1,7 +1,7 @@ package com.dotcms.ai.viewtool; import com.dotcms.ai.api.EmbeddingsAPI; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotcms.ai.app.ConfigService; import com.dotcms.ai.util.EncodingUtil; import com.dotmarketing.beans.Host; diff --git a/dotCMS/src/test/java/com/dotcms/ai/service/OpenAIChatServiceImplTest.java b/dotCMS/src/test/java/com/dotcms/ai/service/OpenAIChatServiceImplTest.java index 9b6ae43d3ef0..a193cf470371 100644 --- a/dotCMS/src/test/java/com/dotcms/ai/service/OpenAIChatServiceImplTest.java +++ b/dotCMS/src/test/java/com/dotcms/ai/service/OpenAIChatServiceImplTest.java @@ -2,7 +2,7 @@ import com.dotcms.ai.model.AIModel; import com.dotcms.ai.app.AIModelType; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotcms.ai.app.AppKeys; import com.dotmarketing.util.json.JSONObject; import org.junit.Before; diff --git a/dotCMS/src/test/java/com/dotcms/ai/service/OpenAIImageServiceImplTest.java b/dotCMS/src/test/java/com/dotcms/ai/service/OpenAIImageServiceImplTest.java index a19706ce4b05..04c116cd83a0 100644 --- a/dotCMS/src/test/java/com/dotcms/ai/service/OpenAIImageServiceImplTest.java +++ b/dotCMS/src/test/java/com/dotcms/ai/service/OpenAIImageServiceImplTest.java @@ -2,7 +2,7 @@ import com.dotcms.ai.model.AIModel; import com.dotcms.ai.app.AIModelType; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotcms.ai.model.AIImageRequestDTO; import com.dotcms.ai.util.StopWordsUtil; import com.dotcms.rest.api.v1.temp.DotTempFile; diff --git a/dotcms-integration/src/test/java/com/dotcms/ai/AiTest.java b/dotcms-integration/src/test/java/com/dotcms/ai/AiTest.java index 3f27f1de6f79..fb529a7dc30f 100644 --- a/dotcms-integration/src/test/java/com/dotcms/ai/AiTest.java +++ b/dotcms-integration/src/test/java/com/dotcms/ai/AiTest.java @@ -1,6 +1,6 @@ package com.dotcms.ai; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotcms.ai.app.AppKeys; import com.dotcms.security.apps.Secret; import com.dotcms.security.apps.Type; diff --git a/dotcms-integration/src/test/java/com/dotcms/ai/viewtool/AIViewToolTest.java b/dotcms-integration/src/test/java/com/dotcms/ai/viewtool/AIViewToolTest.java index 989975c77d1c..0071d755f616 100644 --- a/dotcms-integration/src/test/java/com/dotcms/ai/viewtool/AIViewToolTest.java +++ b/dotcms-integration/src/test/java/com/dotcms/ai/viewtool/AIViewToolTest.java @@ -1,7 +1,7 @@ package com.dotcms.ai.viewtool; import com.dotcms.ai.AiTest; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotcms.datagen.UserDataGen; import com.dotcms.util.IntegrationTestInitService; import com.dotcms.util.network.IPUtils; diff --git a/dotcms-integration/src/test/java/com/dotcms/ai/viewtool/CompletionsToolTest.java b/dotcms-integration/src/test/java/com/dotcms/ai/viewtool/CompletionsToolTest.java index 87c955f8f4b2..a8769c973d5d 100644 --- a/dotcms-integration/src/test/java/com/dotcms/ai/viewtool/CompletionsToolTest.java +++ b/dotcms-integration/src/test/java/com/dotcms/ai/viewtool/CompletionsToolTest.java @@ -1,7 +1,7 @@ package com.dotcms.ai.viewtool; import com.dotcms.ai.AiTest; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotcms.ai.app.AppKeys; import com.dotcms.datagen.EmbeddingsDTODataGen; import com.dotcms.datagen.SiteDataGen; diff --git a/dotcms-integration/src/test/java/com/dotcms/ai/viewtool/EmbeddingsToolTest.java b/dotcms-integration/src/test/java/com/dotcms/ai/viewtool/EmbeddingsToolTest.java index fc657456f125..e208d8e8ec2c 100644 --- a/dotcms-integration/src/test/java/com/dotcms/ai/viewtool/EmbeddingsToolTest.java +++ b/dotcms-integration/src/test/java/com/dotcms/ai/viewtool/EmbeddingsToolTest.java @@ -2,7 +2,7 @@ import com.dotcms.ai.model.AIModel; import com.dotcms.ai.app.AIModelType; -import com.dotcms.ai.config.AppConfig; +import com.dotcms.ai.app.AppConfig; import com.dotcms.datagen.EmbeddingsDTODataGen; import com.dotcms.datagen.SiteDataGen; import com.dotcms.util.IntegrationTestInitService;