Compare commits

..

No commits in common. "974331a028335118d9b1d0384315533f008d4ebe" and "cf0ce425e608ed1a698f3cff5b655bacff0b6f1e" have entirely different histories.

9 changed files with 6 additions and 71 deletions

View File

@ -4,15 +4,13 @@ WORKDIR /web
COPY ./VERSION .
COPY ./web .
RUN npm install --prefix /web/default & \
npm install --prefix /web/berry & \
npm install --prefix /web/air & \
wait
RUN npm install --prefix /web/default && \
npm install --prefix /web/berry && \
npm install --prefix /web/air
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
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
FROM golang:alpine AS builder2

View File

@ -1,23 +0,0 @@
package file
import (
"bytes"
"encoding/base64"
"net/http"
)
func GetFileFromUrl(url string) (mimeType string, data string, err error) {
resp, err := http.Get(url)
if err != nil {
return
}
defer resp.Body.Close()
buffer := bytes.NewBuffer(nil)
_, err = buffer.ReadFrom(resp.Body)
if err != nil {
return
}
mimeType = resp.Header.Get("Content-Type")
data = base64.StdEncoding.EncodeToString(buffer.Bytes())
return
}

View File

@ -36,12 +36,6 @@ func ConvertRequest(request model.GeneralOpenAIRequest) *ChatRequest {
enableSearch = true
aliModel = strings.TrimSuffix(aliModel, EnableSearchModelSuffix)
}
enableThinking := false
if request.ReasoningEffort != nil {
enableThinking = true
}
request.TopP = helper.Float64PtrMax(request.TopP, 0.9999)
return &ChatRequest{
Model: aliModel,
@ -58,7 +52,6 @@ func ConvertRequest(request model.GeneralOpenAIRequest) *ChatRequest {
TopK: request.TopK,
ResultFormat: "message",
Tools: request.Tools,
EnableThinking: enableThinking,
},
}
}

View File

@ -25,7 +25,6 @@ type Parameters struct {
Temperature *float64 `json:"temperature,omitempty"`
ResultFormat string `json:"result_format,omitempty"`
Tools []model.Tool `json:"tools,omitempty"`
EnableThinking bool `json:"enable_thinking,omitempty"`
}
type ChatRequest struct {

View File

@ -17,5 +17,4 @@ var ModelList = []string{
"deepseek-r1",
"deepseek-v3",
"deepseek-v3.1",
}

View File

@ -12,7 +12,6 @@ import (
"github.com/songquanpeng/one-api/common"
"github.com/songquanpeng/one-api/common/config"
"github.com/songquanpeng/one-api/common/file"
"github.com/songquanpeng/one-api/common/helper"
"github.com/songquanpeng/one-api/common/image"
"github.com/songquanpeng/one-api/common/logger"
@ -119,14 +118,6 @@ func ConvertRequest(textRequest model.GeneralOpenAIRequest) *ChatRequest {
parts = append(parts, Part{
Text: part.Text,
})
} else if part.Type == model.ContentTypeInputFile {
mimeType, data, _ := file.GetFileFromUrl(part.File.FileData)
parts = append(parts, Part{
InlineData: &InlineData{
MimeType: mimeType,
Data: data,
},
})
} else if part.Type == model.ContentTypeImageURL {
imageNum += 1
if imageNum > VisionMaxImageNum {

View File

@ -40,11 +40,6 @@ 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"`
@ -55,7 +50,6 @@ 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,5 +4,4 @@ const (
ContentTypeText = "text"
ContentTypeImageURL = "image_url"
ContentTypeInputAudio = "input_audio"
ContentTypeInputFile = "file"
)

View File

@ -121,15 +121,6 @@ func (m Message) ParseContent() []MessageContent {
},
})
}
case ContentTypeInputFile:
if subObj, ok := contentMap["file"].(map[string]any); ok {
contentList = append(contentList, MessageContent{
Type: ContentTypeInputFile,
File: &File{
FileData: subObj["file_data"].(string),
},
})
}
}
}
return contentList
@ -146,10 +137,4 @@ type MessageContent struct {
Type string `json:"type,omitempty"`
Text string `json:"text"`
ImageURL *ImageURL `json:"image_url,omitempty"`
File *File `json:"file,omitempty"`
}
type File struct {
FileData string `json:"file_data,omitempty"`
FileName string `json:"filename,omitempty"`
}