refac: do not change default behaviour

This commit is contained in:
Timothy J. Baek 2024-08-27 15:30:57 +02:00
parent 29cbdbcadd
commit 600409682e
2 changed files with 20 additions and 12 deletions

View File

@ -95,8 +95,8 @@ from config import (
TIKA_SERVER_URL,
RAG_TOP_K,
RAG_RELEVANCE_THRESHOLD,
RAG_MAX_FILE_SIZE,
RAG_MAX_FILE_COUNT,
RAG_FILE_MAX_SIZE,
RAG_FILE_MAX_COUNT,
RAG_EMBEDDING_ENGINE,
RAG_EMBEDDING_MODEL,
RAG_EMBEDDING_MODEL_AUTO_UPDATE,
@ -145,8 +145,8 @@ app.state.config = AppConfig()
app.state.config.TOP_K = RAG_TOP_K
app.state.config.RELEVANCE_THRESHOLD = RAG_RELEVANCE_THRESHOLD
app.state.config.MAX_FILE_SIZE = RAG_MAX_FILE_SIZE
app.state.config.MAX_FILE_COUNT = RAG_MAX_FILE_COUNT
app.state.config.MAX_FILE_SIZE = RAG_FILE_MAX_SIZE
app.state.config.MAX_FILE_COUNT = RAG_FILE_MAX_COUNT
app.state.config.ENABLE_RAG_HYBRID_SEARCH = ENABLE_RAG_HYBRID_SEARCH
app.state.config.ENABLE_RAG_WEB_LOADER_SSL_VERIFICATION = (

View File

@ -1005,16 +1005,24 @@ ENABLE_RAG_HYBRID_SEARCH = PersistentConfig(
os.environ.get("ENABLE_RAG_HYBRID_SEARCH", "").lower() == "true",
)
RAG_MAX_FILE_COUNT = PersistentConfig(
"RAG_MAX_FILE_COUNT",
"rag.max_file_count",
int(os.environ.get("RAG_MAX_FILE_COUNT", "5")),
RAG_FILE_MAX_COUNT = PersistentConfig(
"RAG_FILE_MAX_COUNT",
"rag.file.max_count",
(
int(os.environ.get("RAG_FILE_MAX_COUNT"))
if os.environ.get("RAG_FILE_MAX_COUNT")
else None
),
)
RAG_MAX_FILE_SIZE = PersistentConfig(
"RAG_MAX_FILE_SIZE",
"rag.max_file_size",
int(os.environ.get("RAG_MAX_FILE_SIZE", "10")),
RAG_FILE_MAX_SIZE = PersistentConfig(
"RAG_FILE_MAX_SIZE",
"rag.file.max_size",
(
int(os.environ.get("RAG_FILE_MAX_SIZE"))
if os.environ.get("RAG_FILE_MAX_SIZE")
else None
),
)
ENABLE_RAG_WEB_LOADER_SSL_VERIFICATION = PersistentConfig(