From 0650b889a36d9b9fd42415b9b9819676f839ae9b Mon Sep 17 00:00:00 2001
From: zhaoqingang <zhaoqg0118@163.com>
Date: 星期二, 08 四月 2025 09:54:09 +0800
Subject: [PATCH] 首页会话-模型修改

---
 app/config/config.py |   36 ++++++++++++++++++++++++++++++------
 1 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/app/config/config.py b/app/config/config.py
index 10c3cb8..6e29333 100644
--- a/app/config/config.py
+++ b/app/config/config.py
@@ -1,18 +1,40 @@
+import os
 from pathlib import Path
 import yaml
 
 
 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):
+        # 鏇挎崲閰嶇疆涓殑IP鍦板潃
+        # host_ip = os.getenv('HOST_IP', '127.0.0.1')
+        # kwargs['sgb_base_url'] = kwargs.get('sgb_base_url', '').replace('127.0.0.1', host_ip)
+        # kwargs['sgb_websocket_url'] = kwargs.get('sgb_websocket_url', '').replace('127.0.0.1', host_ip)
+        # kwargs['fwr_base_url'] = kwargs.get('fwr_base_url', '').replace('127.0.0.1', host_ip)
+        # kwargs['sgb_db_url'] = kwargs.get('sgb_db_url', '').replace('127.0.0.1', host_ip)
+        # kwargs['fwr_db_url'] = kwargs.get('fwr_db_url', '').replace('127.0.0.1', host_ip)
+        # kwargs['dify_base_url'] = kwargs.get('dify_base_url', '').replace('127.0.0.1', host_ip)
+        # kwargs['basic_base_url'] = kwargs.get('basic_base_url', '').replace('127.0.0.1', host_ip)
+        # kwargs['dify_database_url'] = kwargs.get('dify_database_url', '').replace('127.0.0.1', host_ip)
         # Check if all required fields are provided and set them
         for field in self.__annotations__.keys():
             if field not in kwargs:
@@ -39,7 +61,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