Skip to content

Commit

Permalink
#29281: Applying feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
victoralfaro-dotcms committed Aug 13, 2024
1 parent 93cfc82 commit e2c1a0e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions dotCMS/src/main/java/com/dotcms/ai/app/AppKeys.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.dotcms.ai.app;

import com.liferay.util.StringPool;

public enum AppKeys {

API_KEY("apiKey", null),
Expand All @@ -22,12 +24,12 @@ public enum AppKeys {
IMAGE_MODEL_TOKENS_PER_MINUTE("imageModelTokensPerMinute", "0"),
IMAGE_MODEL_API_PER_MINUTE("imageModelApiPerMinute", "50"),
IMAGE_MODEL_MAX_TOKENS("imageModelMaxTokens", "0"),
IMAGE_MODEL_COMPLETION("imageModelCompletion", AppKeys.FALSE),
IMAGE_MODEL_COMPLETION("imageModelCompletion", StringPool.FALSE),
EMBEDDINGS_MODEL_NAMES("embeddingsModelNames", null),
EMBEDDINGS_MODEL_TOKENS_PER_MINUTE("embeddingsModelTokensPerMinute", "1000000"),
EMBEDDINGS_MODEL_API_PER_MINUTE("embeddingsModelApiPerMinute", "3000"),
EMBEDDINGS_MODEL_MAX_TOKENS("embeddingsModelMaxTokens", "8191"),
EMBEDDINGS_MODEL_COMPLETION("embeddingsModelCompletion", AppKeys.FALSE),
EMBEDDINGS_MODEL_COMPLETION("embeddingsModelCompletion", StringPool.FALSE),
EMBEDDINGS_SPLIT_AT_TOKENS("com.dotcms.ai.embeddings.split.at.tokens", "512"),
EMBEDDINGS_MINIMUM_TEXT_LENGTH_TO_INDEX("com.dotcms.ai.embeddings.minimum.text.length", "64"),
EMBEDDINGS_MINIMUM_FILE_SIZE_TO_INDEX("com.dotcms.ai.embeddings.minimum.file.size", "1024"),
Expand All @@ -39,7 +41,7 @@ public enum AppKeys {
EMBEDDINGS_CACHE_TTL_SECONDS("com.dotcms.ai.embeddings.cache.ttl.seconds", "600"),
EMBEDDINGS_CACHE_SIZE("com.dotcms.ai.embeddings.cache.size", "1000"),
EMBEDDINGS_DB_DELETE_OLD_ON_UPDATE("com.dotcms.ai.embeddings.delete.old.on.update", "true"),
DEBUG_LOGGING("com.dotcms.ai.debug.logging", AppKeys.FALSE),
DEBUG_LOGGING("com.dotcms.ai.debug.logging", StringPool.FALSE),
COMPLETION_TEMPERATURE("com.dotcms.ai.completion.default.temperature", "1"),
COMPLETION_ROLE_PROMPT(
"com.dotcms.ai.completion.role.prompt",
Expand All @@ -52,8 +54,6 @@ public enum AppKeys {
AI_MODELS_CACHE_TTL("com.dotcms.ai.models.supported.ttl", "28800"),
AI_MODELS_CACHE_SIZE("com.dotcms.ai.models.supported.size", "64");

private static final String FALSE = "false";

public static final String APP_KEY = "dotAI";

public final String key;
Expand Down
2 changes: 1 addition & 1 deletion dotCMS/src/main/java/com/dotcms/ai/util/OpenAIRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static void doRequest(final String urlIn,
final OutputStream out) {

if (!appConfig.isEnabled()) {
AppConfig.debugLogger(OpenAIRequest.class, () -> "dotAI is not enabled and will not send request.");
AppConfig.debugLogger(OpenAIRequest.class, () -> "App dotAI is not enabled and will not send request.");
throw new DotRuntimeException("App dotAI config without API urls or API key");
}

Expand Down
2 changes: 2 additions & 0 deletions dotCMS/src/main/java/com/liferay/util/StringPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,6 @@ public class StringPool {

public static final String TRUE = Boolean.TRUE.toString();

public static final String FALSE = Boolean.FALSE.toString();

}

0 comments on commit e2c1a0e

Please sign in to comment.