2025-02-08 10:27:19 +08:00
|
|
|
from __future__ import annotations
|
|
|
|
|
|
2025-03-16 23:16:06 +08:00
|
|
|
import typing
|
2025-02-08 10:27:19 +08:00
|
|
|
import openai
|
|
|
|
|
|
2025-05-10 17:47:14 +08:00
|
|
|
from . import modelscopechatcmpl
|
2025-02-08 10:27:19 +08:00
|
|
|
|
|
|
|
|
|
2025-04-13 17:47:05 +08:00
|
|
|
class BailianChatCompletions(modelscopechatcmpl.ModelScopeChatCompletions):
|
2025-02-12 11:25:28 +08:00
|
|
|
"""阿里云百炼大模型平台 ChatCompletion API 请求器"""
|
2025-02-08 10:27:19 +08:00
|
|
|
|
|
|
|
|
client: openai.AsyncClient
|
|
|
|
|
|
2025-03-16 23:16:06 +08:00
|
|
|
default_config: dict[str, typing.Any] = {
|
2025-03-29 17:50:45 +08:00
|
|
|
'base_url': 'https://dashscope.aliyuncs.com/compatible-mode/v1',
|
2025-03-16 23:16:06 +08:00
|
|
|
'timeout': 120,
|
|
|
|
|
}
|