34 lines
808 B
Python
34 lines
808 B
Python
import os
|
|
from pydantic_settings import BaseSettings
|
|
|
|
class Settings(BaseSettings):
|
|
# App
|
|
APP_TITLE: str = "LightRAG Knowledge Base API"
|
|
APP_VERSION: str = "1.0"
|
|
HOST: str = "0.0.0.0"
|
|
PORT: int = 9600
|
|
|
|
# Data
|
|
DATA_DIR: str = "./index_data"
|
|
|
|
# LLM
|
|
LLM_BINDING: str = "ollama"
|
|
LLM_BINDING_HOST: str = "http://localhost:11434"
|
|
LLM_MODEL: str = "deepseek-v3.2:cloud"
|
|
|
|
# Embedding
|
|
EMBEDDING_BINDING: str = "ollama"
|
|
EMBEDDING_BINDING_HOST: str = "http://localhost:11434"
|
|
EMBEDDING_MODEL: str = "bge-m3"
|
|
|
|
# RAG Config
|
|
EMBEDDING_DIM: int = 1024
|
|
MAX_TOKEN_SIZE: int = 8192
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
env_file_encoding = 'utf-8'
|
|
extra = "ignore" # 忽略多余的环境变量
|
|
|
|
settings = Settings()
|