Phase 7: Hoàn thiện Modular RAG Backend với FastAPI và Đa LLM Provider

This commit is contained in:
2026-05-08 07:30:30 +00:00
commit 26d1298cf6
51 changed files with 5360 additions and 0 deletions

40
core/config.py Executable file
View File

@@ -0,0 +1,40 @@
import os
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
# Azure AD / Microsoft Graph
tenant_id: str = ""
client_id: str = ""
client_secret: str = ""
# VLM (Vision-Language Model) Configuration
VLM_ENDPOINT: str = "http://10.202.50.3:8080/v1/chat/completions"
VLM_TEMPERATURE: float = 0.1
VLM_MAX_TOKENS: int = 2000
VLM_TIMEOUT: float = 120.0
# SharePoint
sharepoint_site_id: str = ""
sharepoint_drive_id: str = ""
# OpenSearch
opensearch_host: str = "localhost"
opensearch_port: int = 9200
opensearch_user: str = "admin"
opensearch_pass: str = "admin"
# Chat LLM Config
llm_provider: str = "gemini"
gemini_api_key: str = ""
groq_api_key: str = ""
groq_model: str = "llama-3.3-70b-versatile"
local_llm_endpoint: str = "http://10.202.50.3:8081/v1/chat/completions"
openai_api_key: str = ""
# General Settings
log_level: str = "INFO"
environment: str = "development"
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore")
settings = Settings()