refactor: add midjourney pool implementation, add translate prompt for mj drawing

This commit is contained in:
RockYang
2023-12-13 16:38:27 +08:00
parent 8f4d20e411
commit 6d71f24f75
16 changed files with 226 additions and 272 deletions

View File

@@ -2,7 +2,6 @@ package mj
import (
"chatplus/core/types"
"chatplus/utils"
"fmt"
"github.com/imroc/req/v3"
"time"
@@ -18,9 +17,10 @@ type Client struct {
func NewClient(config *types.MidJourneyConfig, proxy string) *Client {
client := req.C().SetTimeout(10 * time.Second)
// set proxy URL
if utils.IsEmptyValue(proxy) {
if proxy != "" {
client.SetProxyURL(proxy)
}
logger.Info(proxy)
return &Client{client: client, config: config}
}