push gitignore
This commit is contained in:
@@ -4,7 +4,7 @@ from pydantic_settings import BaseSettings, SettingsConfigDict
|
|||||||
from pydantic import Field
|
from pydantic import Field
|
||||||
|
|
||||||
# ⚠️ 注意: 您需要安装 pydantic-settings: pip install pydantic-settings
|
# ⚠️ 注意: 您需要安装 pydantic-settings: pip install pydantic-settings
|
||||||
DEBUG = os.environ.get("DEBUG", True)
|
DEBUG = os.environ.get("DEBUG", 1)
|
||||||
|
|
||||||
|
|
||||||
class Settings(BaseSettings):
|
class Settings(BaseSettings):
|
||||||
@@ -34,10 +34,10 @@ class Settings(BaseSettings):
|
|||||||
STYLIST_GUIDE_DIR: str = Field(default="/workspace/lc_stylist_agent/app/core/data/stylist_guide", description="风格指南文本目录")
|
STYLIST_GUIDE_DIR: str = Field(default="/workspace/lc_stylist_agent/app/core/data/stylist_guide", description="风格指南文本目录")
|
||||||
|
|
||||||
# 向量数据库配置参数
|
# 向量数据库配置参数
|
||||||
if DEBUG:
|
if DEBUG == 1:
|
||||||
VECTOR_DB_DIR: str = Field(default="./db", description="向量数据库目录")
|
VECTOR_DB_DIR: str = Field(default="/workspace/lc_stylist_agent/db", description="向量数据库目录")
|
||||||
else:
|
else:
|
||||||
VECTOR_DB_DIR: str = Field(default="./app/db", description="向量数据库目录")
|
VECTOR_DB_DIR: str = Field(default="/db", description="向量数据库目录")
|
||||||
COLLECTION_NAME: str = Field(default="lc_clothing_embedding", description="向量数据库集合名称")
|
COLLECTION_NAME: str = Field(default="lc_clothing_embedding", description="向量数据库集合名称")
|
||||||
EMBEDDING_MODEL_NAME: str = Field(default="openai/clip-vit-base-patch32", description="CLIP嵌入模型名称")
|
EMBEDDING_MODEL_NAME: str = Field(default="openai/clip-vit-base-patch32", description="CLIP嵌入模型名称")
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import logging.config
|
import logging.config
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import litserve as ls
|
import litserve as ls
|
||||||
|
from app.core.config import DEBUG, settings
|
||||||
from app.server.ChatbotAgent.agent_server import LCAgent
|
from app.server.ChatbotAgent.agent_server import LCAgent
|
||||||
from app.server.ChatbotAgent.chatbot_server import LCChatBot
|
from app.server.ChatbotAgent.chatbot_server import LCChatBot
|
||||||
from logging_env import LOGGER_CONFIG_DICT
|
from logging_env import LOGGER_CONFIG_DICT
|
||||||
@@ -20,6 +20,8 @@ logging.config.dictConfig(LOGGER_CONFIG_DICT)
|
|||||||
|
|
||||||
# STEP 2: START THE SERVER
|
# STEP 2: START THE SERVER
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
logger.info(f"DEBUG -> :{DEBUG}")
|
||||||
|
logger.info(f"VECTOR_DB_DIR -> :{settings.VECTOR_DB_DIR}")
|
||||||
chat_boot_api = LCChatBot(enable_async=True, stream=True, api_path='/api/v1/chatbot')
|
chat_boot_api = LCChatBot(enable_async=True, stream=True, api_path='/api/v1/chatbot')
|
||||||
agent_api = LCAgent(enable_async=True, api_path='/api/v1/agent')
|
agent_api = LCAgent(enable_async=True, api_path='/api/v1/agent')
|
||||||
server = ls.LitServer([chat_boot_api, agent_api])
|
server = ls.LitServer([chat_boot_api, agent_api])
|
||||||
|
|||||||
@@ -5,9 +5,12 @@ services:
|
|||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
working_dir: /app
|
working_dir: /app
|
||||||
environment:
|
environment:
|
||||||
GOOGLE_APPLICATION_CREDENTIALS: /app/request.json
|
GOOGLE_APPLICATION_CREDENTIALS: /app/app/request.json
|
||||||
|
DEBUG: 0
|
||||||
volumes:
|
volumes:
|
||||||
- ./app:/app/app
|
- ./app:/app/app
|
||||||
- ./.env:/app/.env
|
- ./.env:/app/.env
|
||||||
|
- ./db:/db
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
ports:
|
ports:
|
||||||
- "10070:8000"
|
- "10070:8000"
|
||||||
Reference in New Issue
Block a user