refac: config
Some checks failed
Deploy to HuggingFace Spaces / check-secret (push) Successful in 15s
Create and publish Docker images with specific build args / build-main-image (linux/amd64) (push) Failing after 2m48s
Create and publish Docker images with specific build args / build-main-image (linux/arm64) (push) Failing after 2m59s
Create and publish Docker images with specific build args / merge-main-images (push) Has been skipped
Create and publish Docker images with specific build args / build-cuda-image (linux/amd64) (push) Failing after 2m38s
Create and publish Docker images with specific build args / build-cuda-image (linux/arm64) (push) Failing after 2m43s
Create and publish Docker images with specific build args / merge-cuda-images (push) Has been skipped
Create and publish Docker images with specific build args / build-ollama-image (linux/amd64) (push) Failing after 3m13s
Create and publish Docker images with specific build args / build-ollama-image (linux/arm64) (push) Failing after 2m55s
Create and publish Docker images with specific build args / merge-ollama-images (push) Has been skipped
Python CI / Format Backend (3.11) (push) Failing after 1m37s
Frontend Build / Format & Build Frontend (push) Failing after 1m8s
Frontend Build / Frontend Unit Tests (push) Failing after 1m1s
Integration Test / Run Cypress Integration Tests (push) Failing after 2m26s
Integration Test / Run Migration Tests (push) Failing after 1m40s
Deploy to HuggingFace Spaces / deploy (push) Has been skipped

This commit is contained in:
Timothy Jaeryang Baek 2024-11-18 14:25:36 -08:00
parent d8693c3c74
commit e4e4110ec0

View File

@ -1127,6 +1127,27 @@ RAG_TEXT_SPLITTER = PersistentConfig(
)
ENABLE_RAG_QUERY_GENERATION = PersistentConfig(
"ENABLE_RAG_QUERY_GENERATION",
"rag.query_generation.enable",
os.environ.get("ENABLE_RAG_QUERY_GENERATION", "False").lower() == "true",
)
DEFAULT_RAG_QUERY_GENERATION_TEMPLATE = """Given the user's message and interaction history, decide if a file search is necessary. You must be concise and exclusively provide a search query if one is necessary. Refrain from verbose responses or any additional commentary. Prefer suggesting a search if uncertain to provide comprehensive or updated information. If a search isn't needed at all, respond with an empty string. Default to a search query when in doubt.
User Message:
{{prompt:end:4000}}
Interaction History:
{{MESSAGES:END:6}}
Search Query:"""
RAG_QUERY_GENERATION_TEMPLATE = PersistentConfig(
"RAG_QUERY_GENERATION_TEMPLATE",
"rag.query_generation.template",
os.environ.get("RAG_QUERY_GENERATION_TEMPLATE", ""),
)
TIKTOKEN_CACHE_DIR = os.environ.get("TIKTOKEN_CACHE_DIR", f"{CACHE_DIR}/tiktoken")
TIKTOKEN_ENCODING_NAME = PersistentConfig(
"TIKTOKEN_ENCODING_NAME",
@ -1181,6 +1202,19 @@ RAG_OPENAI_API_KEY = PersistentConfig(
os.getenv("RAG_OPENAI_API_KEY", OPENAI_API_KEY),
)
RAG_OLLAMA_BASE_URL = PersistentConfig(
"RAG_OLLAMA_BASE_URL",
"rag.ollama.url",
os.getenv("RAG_OLLAMA_BASE_URL", OLLAMA_BASE_URL),
)
RAG_OLLAMA_API_KEY = PersistentConfig(
"RAG_OLLAMA_API_KEY",
"rag.ollama.key",
os.getenv("RAG_OLLAMA_API_KEY", ""),
)
ENABLE_RAG_LOCAL_WEB_FETCH = (
os.getenv("ENABLE_RAG_LOCAL_WEB_FETCH", "False").lower() == "true"
)