fix:
1、add model provider 2、add http defatult timeout 3、Optimize duplicate code
This commit is contained in:
parent
a19fdd89b6
commit
54ec4797e7
1 changed files with 1 additions and 2 deletions
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue