update app/services/ai_analysis_service.py.

class AIAnalysisService:
    def __init__(self):
        # 配置OpenAI客户端连接到Volces API
        self.model = ""  # Volces 模型接入点ID
        self.client = OpenAI(
            api_key = "",  # 豆包大模型APIkey
            base_url = "https://ark.cn-beijing.volces.com/api/v3"
        )

Signed-off-by: monkey <693696817@qq.com>
This commit is contained in:
monkey 2025-09-11 10:47:59 +00:00 committed by Gitee
parent 03fff3fc9e
commit f693e3eef0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -6,10 +6,10 @@ from app.config import Config
class AIAnalysisService:
def __init__(self):
# 配置OpenAI客户端连接到Volces API
self.model = os.getenv('VOLCES_MODEL_ID', 'your_model_id_here') # 从环境变量获取
self.model = "" # Volces 模型接入点ID
self.client = OpenAI(
api_key = os.getenv('VOLCES_API_KEY', 'your_api_key_here'), # 从环境变量获取
base_url = os.getenv('VOLCES_BASE_URL', 'https://ark.cn-beijing.volces.com/api/v3')
api_key = "", # 豆包大模型APIkey
base_url = "https://ark.cn-beijing.volces.com/api/v3"
)
# 创建AI分析结果缓存目录
self.cache_dir = os.path.join(Config.BASE_DIR, "ai_stock_analysis")