From 947cf0d625accd92edf1a5a832b12c2debddfd38 Mon Sep 17 00:00:00 2001
From: zhaoqingang <zhaoqg0118@163.com>
Date: 星期五, 09 五月 2025 14:39:23 +0800
Subject: [PATCH] 配置参数优化
---
app/config/config.py | 34 +++++++++++++++++++++++++++-------
1 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/app/config/config.py b/app/config/config.py
index 0833ef2..2e56510 100644
--- a/app/config/config.py
+++ b/app/config/config.py
@@ -5,16 +5,34 @@
class Settings:
secret_key: str = ''
- bisheng_base_url: str = ''
- bisheng_websocket_url: str = ''
- ragflow_base_url: str = ''
+ sgb_base_url: str = ''
+ sgb_websocket_url: str = ''
+ fwr_base_url: str = ''
database_url: str = ''
+ sgb_db_url: str = ''
+ fwr_db_url: str = ''
+ fetch_sgb_agent: str = ''
+ fetch_fwr_agent: str = ''
PUBLIC_KEY: str
PRIVATE_KEY: str
- bisheng_agent_id: str
-
+ PASSWORD_KEY: str
+ basic_base_url: str = ''
+ basic_paper_url: str = ''
+ dify_base_url: str = ''
+ dify_api_token: str = ''
+ dify_workflow_clean: str = ''
+ dify_workflow_report: str = ''
+ postgresql_database_url: str = ''
+ dify_database_url: str = ''
def __init__(self, **kwargs):
- # Check if all required fields are provided and set them
+ # 鏇挎崲閰嶇疆涓殑IP鍦板潃
+ host_ip = kwargs.get('host_ip', '127.0.0.1')
+ kwargs['fwr_base_url'] = f"http://{host_ip}:11080"
+ kwargs['database_url'] = f"mysql+pymysql://root:infini_rag_flow@{host_ip}:5455/rag_basic"
+ kwargs['fwr_db_url'] = f"mysql+pymysql://root:infini_rag_flow@{host_ip}:15455/rag_flow"
+ kwargs['dify_base_url'] = f"http://{host_ip}:13002"
+ kwargs['postgresql_database_url'] = f"postgresql+asyncpg://kong:kongpass@{host_ip}:5432/kong"
+ kwargs['dify_database_url'] = f"postgresql+psycopg2://postgres:difyai123456@192.168.20.119:15432/dify"
for field in self.__annotations__.keys():
if field not in kwargs:
raise ValueError(f"Missing setting: {field}")
@@ -40,7 +58,9 @@
# Use pathlib to handle file paths
-config_yaml_path = Path(__file__).parent / 'config.yaml'
+# config_yaml_path = os.path.join(os.path.join(Path(__file__).parent, "env_conf"), "config.yaml")
+config_yaml_path = Path(__file__).parent.joinpath("env_conf") / 'config.yaml'
+print(config_yaml_path)
settings_data = load_yaml(config_yaml_path)
# Initialize settings object
--
Gitblit v1.8.0