Skip to content

Commit

Permalink
修复gemini处理图片不正确的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
fruitbars committed Jul 1, 2024
1 parent e572ba8 commit 450a3cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/adapter/gemini_request_openai.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func DeepCopyGeminiRequest(original *googlegemini.GeminiRequest) (*googlegemini.
for i, _ := range copyReq.Contents {
for j, _ := range copyReq.Contents[i].Parts {
if copyReq.Contents[i].Parts[j].InlineData != nil {
d := []byte("...")
d := "..."
copyReq.Contents[i].Parts[j].InlineData.Data = d
}

Expand Down Expand Up @@ -131,7 +131,7 @@ func createPartFromMessageContent(mc openai.ChatMessagePart) (*googlegemini.Part
}
blob := googlegemini.Blob{
MimeType: mimeType,
Data: []byte(imgData),
Data: imgData,
}
return &googlegemini.Part{InlineData: &blob}, nil
default:
Expand Down
2 changes: 1 addition & 1 deletion pkg/llm/google-gemini/gemini_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type Part struct {
// Blob 表示内嵌的媒体字节数据
type Blob struct {
MimeType string `json:"mimeType,omitempty"`
Data []byte `json:"data,omitempty"`
Data string `json:"data,omitempty"`
}

// Entry represents a single entry in the conversation.
Expand Down

0 comments on commit 450a3cc

Please sign in to comment.