mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
feat: add new LLM provider Jiekou.AI (#11300)
### What problem does this PR solve? _Briefly describe what this PR aims to solve. Include background context that will help reviewers understand the purpose of the PR._ ### Type of change - [x] New Feature (non-breaking change which adds functionality) Co-authored-by: Jason <ggbbddjm@gmail.com>
This commit is contained in:
@ -49,6 +49,7 @@ class SupportedLiteLLMProvider(StrEnum):
|
||||
Lingyi_AI = "01.AI"
|
||||
GiteeAI = "GiteeAI"
|
||||
AI_302 = "302.AI"
|
||||
JiekouAI = "Jiekou.AI"
|
||||
|
||||
|
||||
FACTORY_DEFAULT_BASE_URL = {
|
||||
@ -69,6 +70,7 @@ FACTORY_DEFAULT_BASE_URL = {
|
||||
SupportedLiteLLMProvider.GiteeAI: "https://ai.gitee.com/v1/",
|
||||
SupportedLiteLLMProvider.AI_302: "https://api.302.ai/v1",
|
||||
SupportedLiteLLMProvider.Anthropic: "https://api.anthropic.com/",
|
||||
SupportedLiteLLMProvider.JiekouAI: "https://api.jiekou.ai/openai",
|
||||
}
|
||||
|
||||
|
||||
@ -99,6 +101,7 @@ LITELLM_PROVIDER_PREFIX = {
|
||||
SupportedLiteLLMProvider.Lingyi_AI: "openai/",
|
||||
SupportedLiteLLMProvider.GiteeAI: "openai/",
|
||||
SupportedLiteLLMProvider.AI_302: "openai/",
|
||||
SupportedLiteLLMProvider.JiekouAI: "openai/",
|
||||
}
|
||||
|
||||
ChatModel = globals().get("ChatModel", {})
|
||||
|
||||
@ -1397,6 +1397,7 @@ class LiteLLMBase(ABC):
|
||||
"01.AI",
|
||||
"GiteeAI",
|
||||
"302.AI",
|
||||
"Jiekou.AI",
|
||||
]
|
||||
|
||||
def __init__(self, key, model_name, base_url=None, **kwargs):
|
||||
|
||||
@ -931,3 +931,12 @@ class DeerAPIEmbed(OpenAIEmbed):
|
||||
if not base_url:
|
||||
base_url = "https://api.deerapi.com/v1"
|
||||
super().__init__(key, model_name, base_url)
|
||||
|
||||
|
||||
class JiekouAIEmbed(OpenAIEmbed):
|
||||
_FACTORY_NAME = "Jiekou.AI"
|
||||
|
||||
def __init__(self, key, model_name, base_url="https://api.jiekou.ai/openai/v1/embeddings"):
|
||||
if not base_url:
|
||||
base_url = "https://api.jiekou.ai/openai/v1/embeddings"
|
||||
super().__init__(key, model_name, base_url)
|
||||
|
||||
@ -489,3 +489,12 @@ class Ai302Rerank(Base):
|
||||
if not base_url:
|
||||
base_url = "https://api.302.ai/v1/rerank"
|
||||
super().__init__(key, model_name, base_url)
|
||||
|
||||
|
||||
class JiekouAIRerank(JinaRerank):
|
||||
_FACTORY_NAME = "Jiekou.AI"
|
||||
|
||||
def __init__(self, key, model_name, base_url="https://api.jiekou.ai/openai/v1/rerank"):
|
||||
if not base_url:
|
||||
base_url = "https://api.jiekou.ai/openai/v1/rerank"
|
||||
super().__init__(key, model_name, base_url)
|
||||
|
||||
Reference in New Issue
Block a user