Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/main/java/org/codelibs/fess/helper/ChatApiHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,12 @@ public String resolveChatRateLimitKey(final String username, final java.util.fun
}

/**
* Resolves {@code rag.chat.message.max.length} from fess_config system properties,
* defaulting to {@code 4000} on parse failure.
* Resolves {@code rag.chat.message.max.length}, defaulting to {@code 4000} when it is
* unset or unparseable.
*
* <p>This is a system property: it is read from {@code conf/system.properties}, then
* {@code -Dfess.system.rag.chat.message.max.length}. It is deliberately not declared in
* {@code fess_config.properties}, which this channel never consults.
*
* @param fessConfig active Fess config
* @return max chat message length in characters
Expand Down
95 changes: 0 additions & 95 deletions src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -2077,9 +2077,6 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
/** The key of the configuration. e.g. title,url,content,doc_id,content_title,content_description */
String RAG_CHAT_CONTENT_FIELDS = "rag.chat.content.fields";

/** The key of the configuration. e.g. 4000 */
String RAG_CHAT_MESSAGE_MAX_LENGTH = "rag.chat.message.max.length";

/** The key of the configuration. e.g. 500 */
String RAG_CHAT_HIGHLIGHT_FRAGMENT_SIZE = "rag.chat.highlight.fragment.size";

Expand Down Expand Up @@ -2158,15 +2155,6 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
/** The key of the configuration. e.g. 7 */
String THEME_UPLOAD_ATTIC_RETENTION_DAYS = "theme.upload.attic.retention.days";

/** The key of the configuration. e.g. zip */
String THEME_ALLOWED_ARCHIVE_EXTENSIONS = "theme.allowed.archive.extensions";

/** The key of the configuration. e.g. 86400 */
String THEME_ASSETS_CACHE_MAX_AGE = "theme.assets.cache.max.age";

/** The key of the configuration. e.g. true */
String THEME_ASSETS_PRECOMPRESSED = "theme.assets.precompressed";

/** The key of the configuration. e.g. */
String THEME_API_CSRF_SERVER_ORIGINS = "theme.api.csrf.server.origins";

Expand Down Expand Up @@ -9978,21 +9966,6 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
*/
String getRagChatContentFields();

/**
* Get the value for the key 'rag.chat.message.max.length'. <br>
* The value is, e.g. 4000 <br>
* @return The value of found property. (NotNull: if not found, exception but basically no way)
*/
String getRagChatMessageMaxLength();

/**
* Get the value for the key 'rag.chat.message.max.length' as {@link Integer}. <br>
* The value is, e.g. 4000 <br>
* @return The value of found property. (NotNull: if not found, exception but basically no way)
* @throws NumberFormatException When the property is not integer.
*/
Integer getRagChatMessageMaxLengthAsInteger();

/**
* Get the value for the key 'rag.chat.highlight.fragment.size'. <br>
* The value is, e.g. 500 <br>
Expand Down Expand Up @@ -10385,42 +10358,6 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
*/
Integer getThemeUploadAtticRetentionDaysAsInteger();

/**
* Get the value for the key 'theme.allowed.archive.extensions'. <br>
* The value is, e.g. zip <br>
* @return The value of found property. (NotNull: if not found, exception but basically no way)
*/
String getThemeAllowedArchiveExtensions();

/**
* Get the value for the key 'theme.assets.cache.max.age'. <br>
* The value is, e.g. 86400 <br>
* @return The value of found property. (NotNull: if not found, exception but basically no way)
*/
String getThemeAssetsCacheMaxAge();

/**
* Get the value for the key 'theme.assets.cache.max.age' as {@link Integer}. <br>
* The value is, e.g. 86400 <br>
* @return The value of found property. (NotNull: if not found, exception but basically no way)
* @throws NumberFormatException When the property is not integer.
*/
Integer getThemeAssetsCacheMaxAgeAsInteger();

/**
* Get the value for the key 'theme.assets.precompressed'. <br>
* The value is, e.g. true <br>
* @return The value of found property. (NotNull: if not found, exception but basically no way)
*/
String getThemeAssetsPrecompressed();

/**
* Is the property for the key 'theme.assets.precompressed' true? <br>
* The value is, e.g. true <br>
* @return The determination, true or false. (if not found, exception but basically no way)
*/
boolean isThemeAssetsPrecompressed();

/**
* Get the value for the key 'theme.api.csrf.server.origins'. <br>
* The value is, e.g. <br>
Expand Down Expand Up @@ -14176,14 +14113,6 @@ public String getRagChatContentFields() {
return get(FessConfig.RAG_CHAT_CONTENT_FIELDS);
}

public String getRagChatMessageMaxLength() {
return get(FessConfig.RAG_CHAT_MESSAGE_MAX_LENGTH);
}

public Integer getRagChatMessageMaxLengthAsInteger() {
return getAsInteger(FessConfig.RAG_CHAT_MESSAGE_MAX_LENGTH);
}

public String getRagChatHighlightFragmentSize() {
return get(FessConfig.RAG_CHAT_HIGHLIGHT_FRAGMENT_SIZE);
}
Expand Down Expand Up @@ -14372,26 +14301,6 @@ public Integer getThemeUploadAtticRetentionDaysAsInteger() {
return getAsInteger(FessConfig.THEME_UPLOAD_ATTIC_RETENTION_DAYS);
}

public String getThemeAllowedArchiveExtensions() {
return get(FessConfig.THEME_ALLOWED_ARCHIVE_EXTENSIONS);
}

public String getThemeAssetsCacheMaxAge() {
return get(FessConfig.THEME_ASSETS_CACHE_MAX_AGE);
}

public Integer getThemeAssetsCacheMaxAgeAsInteger() {
return getAsInteger(FessConfig.THEME_ASSETS_CACHE_MAX_AGE);
}

public String getThemeAssetsPrecompressed() {
return get(FessConfig.THEME_ASSETS_PRECOMPRESSED);
}

public boolean isThemeAssetsPrecompressed() {
return is(FessConfig.THEME_ASSETS_PRECOMPRESSED);
}

public String getThemeApiCsrfServerOrigins() {
return get(FessConfig.THEME_API_CSRF_SERVER_ORIGINS);
}
Expand Down Expand Up @@ -15060,7 +14969,6 @@ protected java.util.Map<String, String> prepareGeneratedDefaultMap() {
defaultMap.put(FessConfig.RAG_CHAT_SESSION_MAX_SIZE, "10000");
defaultMap.put(FessConfig.RAG_CHAT_HISTORY_MAX_MESSAGES, "30");
defaultMap.put(FessConfig.RAG_CHAT_CONTENT_FIELDS, "title,url,content,doc_id,content_title,content_description");
defaultMap.put(FessConfig.RAG_CHAT_MESSAGE_MAX_LENGTH, "4000");
defaultMap.put(FessConfig.RAG_CHAT_HIGHLIGHT_FRAGMENT_SIZE, "500");
defaultMap.put(FessConfig.RAG_CHAT_HIGHLIGHT_NUMBER_OF_FRAGMENTS, "3");
defaultMap.put(FessConfig.RAG_CHAT_CONTENT_FULLTEXT_MAX_LENGTH, "3000");
Expand All @@ -15087,9 +14995,6 @@ protected java.util.Map<String, String> prepareGeneratedDefaultMap() {
defaultMap.put(FessConfig.THEME_UPLOAD_ZIP_RATIO_MAX, "50");
defaultMap.put(FessConfig.THEME_UPLOAD_ZIP_RATIO_CHECK_THRESHOLD_BYTES, "65536");
defaultMap.put(FessConfig.THEME_UPLOAD_ATTIC_RETENTION_DAYS, "7");
defaultMap.put(FessConfig.THEME_ALLOWED_ARCHIVE_EXTENSIONS, "zip");
defaultMap.put(FessConfig.THEME_ASSETS_CACHE_MAX_AGE, "86400");
defaultMap.put(FessConfig.THEME_ASSETS_PRECOMPRESSED, "true");
defaultMap.put(FessConfig.THEME_API_CSRF_SERVER_ORIGINS, "");
defaultMap.put(FessConfig.THEME_API_LOGIN_RATE_LIMIT_PER_IP_PER_MINUTE, "10");
defaultMap.put(FessConfig.THEME_API_LOGIN_RATE_LIMIT_PER_USER_PER_MINUTE, "5");
Expand Down
8 changes: 0 additions & 8 deletions src/main/resources/fess_config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1722,8 +1722,6 @@ rag.chat.history.max.messages=30
# Enhanced RAG flow settings.
# Fields to retrieve for full document content.
rag.chat.content.fields=title,url,content,doc_id,content_title,content_description
# Maximum characters accepted in a chat API message. Read from conf/system.properties, not this file.
rag.chat.message.max.length=4000
# Highlight settings for RAG search.
rag.chat.highlight.fragment.size=500
# Number of highlight fragments per document in the RAG chat context search.
Expand Down Expand Up @@ -1788,12 +1786,6 @@ theme.upload.zip.ratio.max=50
theme.upload.zip.ratio.check.threshold.bytes=65536
# Retention (days) for a replaced theme directory before the cleanup sweep removes it.
theme.upload.attic.retention.days=7
# Archive extensions accepted for theme upload. Not read: the upload action accepts only .zip.
theme.allowed.archive.extensions=zip
# Cache-Control max-age (seconds) for theme assets. Not read: the responder always sends 86400.
theme.assets.cache.max.age=86400
# Whether to serve precompressed theme assets. Not read: no precompressed asset path exists.
theme.assets.precompressed=true
# Optional: canonical external origin(s) of this Fess instance (comma/newline separated),
# e.g. https://fess.example.com. When set, these are treated as same-origin for the v2 CSRF
# Origin check WITHOUT trusting forwarded headers. Recommended behind reverse proxies that are
Expand Down
Loading