1、add model provider
2、add http defatult timeout
3、Optimize duplicate code
This commit is contained in:
tong3jie 2026-03-20 11:35:54 +08:00
parent a19fdd89b6
commit 54ec4797e7

View file

@ -46,6 +46,7 @@ var vendorPrefixes = map[string]struct{}{
"mistral": {}, "mistral": {},
"vivgrid": {}, "vivgrid": {},
"minimax": {}, "minimax": {},
"novita": {},
} }
type Provider struct { type Provider struct {
@ -121,9 +122,7 @@ func NewProvider(apiKey, apiBase, proxy string, opts ...Option) *Provider {
apiBase: strings.TrimRight(apiBase, "/"), apiBase: strings.TrimRight(apiBase, "/"),
httpClient: retryClient.StandardClient(), httpClient: retryClient.StandardClient(),
} }
p.httpClient.Timeout = defaultRequestTimeout p.httpClient.Timeout = defaultRequestTimeout
for _, opt := range opts { for _, opt := range opts {
if opt != nil { if opt != nil {
opt(p) opt(p)