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": {},
"vivgrid": {},
"minimax": {},
"novita": {},
}
type Provider struct {
@ -121,9 +122,7 @@ func NewProvider(apiKey, apiBase, proxy string, opts ...Option) *Provider {
apiBase: strings.TrimRight(apiBase, "/"),
httpClient: retryClient.StandardClient(),
}
p.httpClient.Timeout = defaultRequestTimeout
for _, opt := range opts {
if opt != nil {
opt(p)