build:dockerfile

This commit is contained in:
suziheng 2025-09-15 16:18:27 +08:00
parent 2174039fce
commit a529eab39e
4 changed files with 23 additions and 11 deletions

View File

@ -4,17 +4,15 @@ WORKDIR /web
COPY ./VERSION .
COPY ./web .
WORKDIR /web/default
RUN npm install --force
RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build
RUN npm install --prefix /web/default & \
npm install --prefix /web/berry & \
npm install --prefix /web/air & \
wait
WORKDIR /web/berry
RUN npm install --force
RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build
WORKDIR /web/air
RUN npm install --force
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 --prefix /web/default & \
DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat ./VERSION) npm run build --prefix /web/berry & \
DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat ./VERSION) npm run build --prefix /web/air & \
wait
FROM golang:alpine AS builder2

View File

@ -118,6 +118,13 @@ func ConvertRequest(textRequest model.GeneralOpenAIRequest) *ChatRequest {
parts = append(parts, Part{
Text: part.Text,
})
} else if part.Type == model.ContentTypeInputPdf {
parts = append(parts, Part{
FileData: &FileData{
MimeType: "application/pdf",
FileUri: part.ImageURL.Url,
},
})
} else if part.Type == model.ContentTypeImageURL {
imageNum += 1
if imageNum > VisionMaxImageNum {

View File

@ -40,6 +40,11 @@ type InlineData struct {
Data string `json:"data"`
}
type FileData struct {
MimeType string `json:"mime_type"`
FileUri string `json:"file_uri"`
}
type FunctionCall struct {
FunctionName string `json:"name"`
Arguments any `json:"args"`
@ -50,6 +55,7 @@ type Part struct {
InlineData *InlineData `json:"inlineData,omitempty"`
FunctionCall *FunctionCall `json:"functionCall,omitempty"`
Thought bool `json:"thought,omitempty"`
FileData *FileData `json:"fileData,omitempty"`
}
type ChatContent struct {

View File

@ -4,4 +4,5 @@ const (
ContentTypeText = "text"
ContentTypeImageURL = "image_url"
ContentTypeInputAudio = "input_audio"
ContentTypeInputPdf = "application/pdf"
)