to:sync
This commit is contained in:
parent
73c5062c45
commit
bc6978ef77
@ -28,8 +28,8 @@ func InitAiGroup(g *echo.Group) {
|
||||
key := utils.ToString(corpId) + "_" + utils.ToString(bizId) + "_" + utils.ToString(uid)
|
||||
groupId := utils.GetCache(key)
|
||||
result, err := remote_http.AiApi.Completions(ctx, req.Prompt, groupId)
|
||||
if err != nil {
|
||||
return c.JSON(500, err)
|
||||
if err != nil || result == nil {
|
||||
return c.JSON(http.StatusOK, utils.Failed(err.Error()))
|
||||
}
|
||||
|
||||
//缓存
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"ai-gateway/common/dto"
|
||||
"ai-gateway/common/utils"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
@ -25,14 +26,13 @@ func (aiApiImpl) Completions(ctx context.Context, prompt, groupId string) (*dto.
|
||||
SetSuccessResult(&aiResult).
|
||||
Post(url)
|
||||
if err != nil {
|
||||
|
||||
logger.Error(fmt.Sprintf("remote_http_wx_SendMsg error: %s", err.Error()))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !resp.IsSuccessState() {
|
||||
logger.Error(fmt.Sprintf("remote_http_wx_SendMsg resp:%+v", resp))
|
||||
return nil, err
|
||||
return nil, errors.New("接口异常")
|
||||
}
|
||||
|
||||
return &aiResult.Data, nil
|
||||
|
@ -32,7 +32,7 @@ job "${APP_NAME}-${CI_COMMIT_BRANCH}-job" {
|
||||
network_mode = "djLay"
|
||||
# No port map required.
|
||||
|
||||
volumes = ["/opt/settings/server.properties:/opt/settings/server.properties"]
|
||||
# volumes = ["/opt/settings/server.properties:/opt/settings/server.properties"]
|
||||
|
||||
auth {
|
||||
server_address = "${CI_REGISTRY}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user