mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-17 09:16:36 +08:00
build:dockerfile
This commit is contained in:
parent
2174039fce
commit
a529eab39e
18
Dockerfile
18
Dockerfile
@ -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
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -4,4 +4,5 @@ const (
|
||||
ContentTypeText = "text"
|
||||
ContentTypeImageURL = "image_url"
|
||||
ContentTypeInputAudio = "input_audio"
|
||||
ContentTypeInputPdf = "application/pdf"
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user