This commit is contained in:
songzhuoyuan
2026-08-11 20:41:31 +08:00
parent 2ce13e5bae
commit befdc32aea
24 changed files with 1311 additions and 530 deletions
+4 -1
View File
@@ -1,5 +1,6 @@
import openai
import json
import os
from typing import Dict, List, Any, Optional
import config
@@ -10,7 +11,9 @@ class DeepSeekClient:
self.model = model or config.DEFAULT_MODEL_NAME
self.client = openai.OpenAI(
api_key=config.DEEPSEEK_API_KEY,
base_url=config.DEEPSEEK_BASE_URL
base_url=config.DEEPSEEK_BASE_URL,
timeout=float(os.getenv('DEEPSEEK_TIMEOUT', '180')),
max_retries=int(os.getenv('DEEPSEEK_MAX_RETRIES', '1'))
)
def call_api(self, messages: List[Dict[str, str]], model: Optional[str] = None,