mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Feat: add gitee as LLM provider. (#8545)
### What problem does this PR solve? ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -45,7 +45,8 @@ from .embedding_model import (
|
||||
HuggingFaceEmbed,
|
||||
VolcEngineEmbed,
|
||||
GPUStackEmbed,
|
||||
NovitaEmbed
|
||||
NovitaEmbed,
|
||||
GiteeEmbed
|
||||
)
|
||||
from .chat_model import (
|
||||
GptTurbo,
|
||||
@ -87,6 +88,7 @@ from .chat_model import (
|
||||
HuggingFaceChat,
|
||||
GPUStackChat,
|
||||
ModelScopeChat,
|
||||
GiteeChat
|
||||
)
|
||||
|
||||
from .cv_model import (
|
||||
@ -129,7 +131,8 @@ from .rerank_model import (
|
||||
QWenRerank,
|
||||
GPUStackRerank,
|
||||
HuggingfaceRerank,
|
||||
NovitaRerank
|
||||
NovitaRerank,
|
||||
GiteeRerank
|
||||
)
|
||||
|
||||
from .sequence2txt_model import (
|
||||
@ -139,6 +142,7 @@ from .sequence2txt_model import (
|
||||
XinferenceSeq2txt,
|
||||
TencentCloudSeq2txt,
|
||||
GPUStackSeq2txt,
|
||||
GiteeSeq2txt
|
||||
)
|
||||
|
||||
from .tts_model import (
|
||||
@ -182,7 +186,8 @@ EmbeddingModel = {
|
||||
"HuggingFace": HuggingFaceEmbed,
|
||||
"VolcEngine": VolcEngineEmbed,
|
||||
"GPUStack": GPUStackEmbed,
|
||||
"NovitaAI": NovitaEmbed
|
||||
"NovitaAI": NovitaEmbed,
|
||||
"GiteeAI": GiteeEmbed
|
||||
}
|
||||
|
||||
CvModel = {
|
||||
@ -206,7 +211,7 @@ CvModel = {
|
||||
"Tencent Hunyuan": HunyuanCV,
|
||||
"Anthropic": AnthropicCV,
|
||||
"SILICONFLOW": SILICONFLOWCV,
|
||||
"GPUStack": GPUStackCV,
|
||||
"GPUStack": GPUStackCV
|
||||
}
|
||||
|
||||
ChatModel = {
|
||||
@ -250,6 +255,7 @@ ChatModel = {
|
||||
"HuggingFace": HuggingFaceChat,
|
||||
"GPUStack": GPUStackChat,
|
||||
"ModelScope":ModelScopeChat,
|
||||
"GiteeAI": GiteeChat
|
||||
}
|
||||
|
||||
RerankModel = {
|
||||
@ -270,7 +276,8 @@ RerankModel = {
|
||||
"Tongyi-Qianwen": QWenRerank,
|
||||
"GPUStack": GPUStackRerank,
|
||||
"HuggingFace": HuggingfaceRerank,
|
||||
"NovitaAI": NovitaRerank
|
||||
"NovitaAI": NovitaRerank,
|
||||
"GiteeAI": GiteeRerank
|
||||
}
|
||||
|
||||
Seq2txtModel = {
|
||||
@ -280,6 +287,7 @@ Seq2txtModel = {
|
||||
"Xinference": XinferenceSeq2txt,
|
||||
"Tencent Cloud": TencentCloudSeq2txt,
|
||||
"GPUStack": GPUStackSeq2txt,
|
||||
"GiteeAI": GiteeSeq2txt
|
||||
}
|
||||
|
||||
TTSModel = {
|
||||
|
||||
@ -1253,6 +1253,13 @@ class YiChat(Base):
|
||||
super().__init__(key, model_name, base_url, **kwargs)
|
||||
|
||||
|
||||
class GiteeChat(Base):
|
||||
def __init__(self, key, model_name, base_url="https://ai.gitee.com/v1/", **kwargs):
|
||||
if not base_url:
|
||||
base_url = "https://ai.gitee.com/v1/"
|
||||
super().__init__(key, model_name, base_url, **kwargs)
|
||||
|
||||
|
||||
class ReplicateChat(Base):
|
||||
def __init__(self, key, model_name, base_url=None, **kwargs):
|
||||
super().__init__(key, model_name, base_url=base_url, **kwargs)
|
||||
|
||||
@ -911,4 +911,9 @@ class GPUStackEmbed(OpenAIEmbed):
|
||||
|
||||
class NovitaEmbed(SILICONFLOWEmbed):
|
||||
def __init__(self, key, model_name, base_url="https://api.novita.ai/v3/openai/embeddings"):
|
||||
super().__init__(key, model_name, base_url)
|
||||
|
||||
|
||||
class GiteeEmbed(SILICONFLOWEmbed):
|
||||
def __init__(self, key, model_name, base_url="https://ai.gitee.com/v1/embeddings"):
|
||||
super().__init__(key, model_name, base_url)
|
||||
@ -629,4 +629,9 @@ class GPUStackRerank(Base):
|
||||
|
||||
class NovitaRerank(JinaRerank):
|
||||
def __init__(self, key, model_name, base_url="https://api.novita.ai/v3/openai/rerank"):
|
||||
super().__init__(key, model_name, base_url)
|
||||
|
||||
|
||||
class GiteeRerank(JinaRerank):
|
||||
def __init__(self, key, model_name, base_url="https://ai.gitee.com/v1/rerank"):
|
||||
super().__init__(key, model_name, base_url)
|
||||
@ -203,3 +203,11 @@ class GPUStackSeq2txt(Base):
|
||||
self.base_url = base_url
|
||||
self.model_name = model_name
|
||||
self.key = key
|
||||
|
||||
|
||||
class GiteeSeq2txt(Base):
|
||||
def __init__(self, key, model_name="whisper-1", base_url="https://ai.gitee.com/v1/"):
|
||||
if not base_url:
|
||||
base_url = "https://ai.gitee.com/v1/"
|
||||
self.client = OpenAI(api_key=key, base_url=base_url)
|
||||
self.model_name = model_name
|
||||
Reference in New Issue
Block a user