feat: add sub2api source compatibility

This commit is contained in:
chick
2026-06-01 20:14:27 +08:00
parent 5f59b4bed3
commit 00962c3653
12 changed files with 527 additions and 25 deletions
+17 -8
View File
@@ -11,14 +11,23 @@ const (
// ModelChannel 模型渠道配置。
type ModelChannel struct {
Protocol string `json:"protocol"`
Name string `json:"name"`
BaseURL string `json:"baseUrl"`
APIKey string `json:"apiKey"`
Models []string `json:"models"`
Weight int `json:"weight"`
Enabled bool `json:"enabled"`
Remark string `json:"remark"`
Protocol string `json:"protocol"`
Compatibility string `json:"compatibility"`
Name string `json:"name"`
BaseURL string `json:"baseUrl"`
APIKey string `json:"apiKey"`
Models []string `json:"models"`
Weight int `json:"weight"`
Enabled bool `json:"enabled"`
Remark string `json:"remark"`
RequestOptions ModelRequestOptions `json:"requestOptions"`
}
// ModelRequestOptions 控制 OpenAI 兼容接口的可选请求参数。
type ModelRequestOptions struct {
// ImageResponseFormat 为图片生成/编辑请求设置 response_format。
// OpenAI 默认使用 b64_jsonSub2API 推荐使用 url,避免部分上游不返回 b64_json。
ImageResponseFormat string `json:"imageResponseFormat"`
}
// ModelCost 模型算力点配置。