feat: add supports for open router (#1422)

This commit is contained in:
Junyan Qin (Chin)
2025-05-14 21:28:33 +08:00
committed by GitHub
parent 20a62fcf69
commit f376c9703a
3 changed files with 55 additions and 0 deletions
@@ -0,0 +1,17 @@
from __future__ import annotations
import typing
import openai
from . import modelscopechatcmpl
class OpenRouterChatCompletions(modelscopechatcmpl.ModelScopeChatCompletions):
"""OpenRouter ChatCompletion API 请求器"""
client: openai.AsyncClient
default_config: dict[str, typing.Any] = {
'base_url': 'https://openrouter.ai/api/v1',
'timeout': 120,
}