修改流式的实现,按照流式的格式去输出,不直接return
This commit is contained in:
parent
5e3042752e
commit
9267c5f12e
@ -5,15 +5,15 @@ COPY ./VERSION .
|
|||||||
COPY ./web .
|
COPY ./web .
|
||||||
|
|
||||||
WORKDIR /web/default
|
WORKDIR /web/default
|
||||||
RUN npm install
|
RUN npm config set registry https://mirrors.huaweicloud.com/repository/npm/ && npm install
|
||||||
RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build
|
RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build
|
||||||
|
|
||||||
WORKDIR /web/berry
|
WORKDIR /web/berry
|
||||||
RUN npm install
|
RUN npm config set registry https://mirrors.huaweicloud.com/repository/npm/ && npm install
|
||||||
RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build
|
RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build
|
||||||
|
|
||||||
WORKDIR /web/air
|
WORKDIR /web/air
|
||||||
RUN npm install
|
RUN npm config set registry https://mirrors.huaweicloud.com/repository/npm/ && npm install
|
||||||
RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build
|
RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build
|
||||||
|
|
||||||
FROM golang:alpine AS builder2
|
FROM golang:alpine AS builder2
|
||||||
|
@ -202,7 +202,8 @@ func StreamHandler(c *gin.Context, resp *http.Response) (*model.ErrorWithStatusC
|
|||||||
|
|
||||||
// Check for known error codes and handle accordingly
|
// Check for known error codes and handle accordingly
|
||||||
if aliResponse.Code != "" {
|
if aliResponse.Code != "" {
|
||||||
return &model.ErrorWithStatusCode{
|
|
||||||
|
errorResponse := &model.ErrorWithStatusCode{
|
||||||
Error: model.Error{
|
Error: model.Error{
|
||||||
Message: aliResponse.Message,
|
Message: aliResponse.Message,
|
||||||
Type: aliResponse.Code,
|
Type: aliResponse.Code,
|
||||||
@ -210,7 +211,14 @@ func StreamHandler(c *gin.Context, resp *http.Response) (*model.ErrorWithStatusC
|
|||||||
Code: aliResponse.Code,
|
Code: aliResponse.Code,
|
||||||
},
|
},
|
||||||
StatusCode: resp.StatusCode,
|
StatusCode: resp.StatusCode,
|
||||||
}, nil
|
}
|
||||||
|
|
||||||
|
err = render.ObjectData(c, errorResponse)
|
||||||
|
if err != nil {
|
||||||
|
logger.SysError(err.Error())
|
||||||
|
}
|
||||||
|
render.Done(c)
|
||||||
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if aliResponse.Usage.OutputTokens != 0 {
|
if aliResponse.Usage.OutputTokens != 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user