perf: deepseek

This commit is contained in:
feng
2025-02-13 15:57:10 +08:00
committed by ZhaoJiSen
parent 404d58a9c9
commit c0ffe45ce9
11 changed files with 48 additions and 20 deletions

View File

@@ -41,16 +41,21 @@ class ChatAITestingAPI(GenericAPIView):
data={'msg': _('Chat AI is not enabled')}
)
proxy = config['GPT_PROXY']
tp = config['CHAT_AI_TYPE']
if tp == ChatAITypeChoices.gpt:
url = config['GPT_BASE_URL']
api_key = config['GPT_API_KEY']
proxy = config['GPT_PROXY']
model = config['GPT_MODEL']
else:
url = config['DEEPSEEK_BASE_URL']
api_key = config['DEEPSEEK_API_KEY']
proxy = config['DEEPSEEK_PROXY']
model = config['DEEPSEEK_MODEL']
kwargs = {
'base_url': config['GPT_BASE_URL'] or None,
'api_key': config['GPT_API_KEY'],
'base_url': url or None,
'api_key': api_key,
}
try:
if proxy: