add support for StepFun (#1611)

### What problem does this PR solve?

#1561 

### Type of change
- [x] New Feature (non-breaking change which adds functionality)

---------

Co-authored-by: Zhedong Cen <cenzhedong2@126.com>
This commit is contained in:
黄腾
2024-07-19 16:26:12 +08:00
committed by GitHub
parent 264303ba98
commit 347cb61f26
6 changed files with 12611 additions and 0 deletions

View File

@ -71,6 +71,7 @@ ChatModel = {
"Bedrock": BedrockChat,
"Groq": GroqChat,
'OpenRouter':OpenRouterChat,
"StepFun":StepFunChat
}

View File

@ -897,3 +897,9 @@ class OpenRouterChat(Base):
self.base_url = "https://openrouter.ai/api/v1"
self.client = OpenAI(base_url=self.base_url, api_key=key)
self.model_name = model_name
class StepFunChat(Base):
def __init__(self, key, model_name, base_url="https://api.stepfun.com/v1/chat/completions"):
if not base_url:
base_url = "https://api.stepfun.com/v1/chat/completions"
super().__init__(key, model_name, base_url)