mirror of
https://github.com/RockChinQ/QChatGPT.git
synced 2024-11-16 11:42:44 +08:00
feat: 支持 deepseek 的模型
This commit is contained in:
parent
9bc248f5bc
commit
9c6491e5ee
15
pkg/provider/modelmgr/apis/deepseekchatcmpl.py
Normal file
15
pkg/provider/modelmgr/apis/deepseekchatcmpl.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from ....core import app
|
||||
|
||||
from . import chatcmpl
|
||||
from .. import api
|
||||
|
||||
|
||||
@api.requester_class("deepseek-chat-completions")
|
||||
class DeepseekChatCompletions(chatcmpl.OpenAIChatCompletions):
|
||||
"""Deepseek ChatCompletion API 请求器"""
|
||||
|
||||
def __init__(self, ap: app.Application):
|
||||
self.requester_cfg = ap.provider_cfg.data['requester']['deepseek-chat-completions']
|
||||
self.ap = ap
|
|
@ -6,7 +6,7 @@ from . import entities
|
|||
from ...core import app
|
||||
|
||||
from . import token, api
|
||||
from .apis import chatcmpl, anthropicmsgs, moonshotchatcmpl
|
||||
from .apis import chatcmpl, anthropicmsgs, moonshotchatcmpl, deepseekchatcmpl
|
||||
|
||||
FETCH_MODEL_LIST_URL = "https://api.qchatgpt.rockchin.top/api/v2/fetch/model_list"
|
||||
|
||||
|
|
|
@ -59,6 +59,11 @@
|
|||
"name": "moonshot-v1-128k",
|
||||
"requester": "moonshot-chat-completions",
|
||||
"token_mgr": "moonshot"
|
||||
},
|
||||
{
|
||||
"name": "deepseek-chat",
|
||||
"requester": "deepseek-chat-completions",
|
||||
"token_mgr": "deepseek"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -9,6 +9,9 @@
|
|||
],
|
||||
"moonshot": [
|
||||
"sk-1234567890"
|
||||
],
|
||||
"deepseek": [
|
||||
"sk-1234567890"
|
||||
]
|
||||
},
|
||||
"requester": {
|
||||
|
@ -28,6 +31,11 @@
|
|||
"base-url": "https://api.moonshot.cn/v1",
|
||||
"args": {},
|
||||
"timeout": 120
|
||||
},
|
||||
"deepseek-chat-completions": {
|
||||
"base-url": "https://api.deepseek.com",
|
||||
"args": {},
|
||||
"timeout": 120
|
||||
}
|
||||
},
|
||||
"model": "gpt-3.5-turbo",
|
||||
|
|
Loading…
Reference in New Issue
Block a user