Add RAG configuration options and enhance parameter configurability

- Add top-k and cosine-threshold parms for api server
- Update .env and cli parms handling with new parameters
- Improve splash screen display
- Update bash and storage classes to read new parameters from .env file.
This commit is contained in:
yangdx
2025-01-29 21:34:34 +08:00
parent d0052456d4
commit 7aedc08caf
4 changed files with 42 additions and 12 deletions

View File

@@ -1,3 +1,4 @@
import os
from dataclasses import dataclass, field
from typing import (
TypedDict,
@@ -32,7 +33,7 @@ class QueryParam:
response_type: str = "Multiple Paragraphs"
stream: bool = False
# Number of top-k items to retrieve; corresponds to entities in "local" mode and relationships in "global" mode.
top_k: int = 60
top_k: int = int(os.getenv("TOP_K", "60"))
# Number of document chunks to retrieve.
# top_n: int = 10
# Number of tokens for the original chunks.