feat: 添加指定模型的能力 (#74)

This commit is contained in:
二丫讲梵
2023-03-07 13:29:05 +08:00
committed by GitHub
parent ab6ecc3f26
commit acb5462a01
8 changed files with 71 additions and 46 deletions

View File

@@ -5,15 +5,14 @@ import (
"fmt"
"time"
"github.com/eryajf/chatgpt-dingtalk/config"
"github.com/go-resty/resty/v2"
)
func InitAiCli() *resty.Client {
if config.LoadConfig().HttpProxy != "" {
return resty.New().SetTimeout(30*time.Second).SetHeader("Authorization", fmt.Sprintf("Bearer %s", config.LoadConfig().ApiKey)).SetProxy(config.LoadConfig().HttpProxy).SetRetryCount(3).SetRetryWaitTime(5 * time.Second)
if Config.HttpProxy != "" {
return resty.New().SetTimeout(30*time.Second).SetHeader("Authorization", fmt.Sprintf("Bearer %s", Config.ApiKey)).SetProxy(Config.HttpProxy).SetRetryCount(3).SetRetryWaitTime(5 * time.Second)
}
return resty.New().SetTimeout(30*time.Second).SetHeader("Authorization", fmt.Sprintf("Bearer %s", config.LoadConfig().ApiKey)).SetRetryCount(3).SetRetryWaitTime(5 * time.Second)
return resty.New().SetTimeout(30*time.Second).SetHeader("Authorization", fmt.Sprintf("Bearer %s", Config.ApiKey)).SetRetryCount(3).SetRetryWaitTime(5 * time.Second)
}
type Billing struct {