Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7c543a9e
authored
Oct 13, 2025
by
skynono
Committed by
GitHub
Oct 13, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: jimeng images base64 limit (#2032)
parent
c6175c0b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
relay/channel/task/jimeng/adaptor.go
+12
-3
No files found.
relay/channel/task/jimeng/adaptor.go
View file @
7c543a9e
...
...
@@ -65,6 +65,11 @@ type responseTask struct {
TimeElapsed
string
`json:"time_elapsed"`
}
const
(
// 即梦限制单个文件最大4.7MB https://www.volcengine.com/docs/85621/1747301
MaxFileSize
int64
=
4
*
1024
*
1024
+
700
*
1024
// 4.7MB (4MB + 724KB)
)
// ============================
// Adaptor implementation
// ============================
...
...
@@ -127,15 +132,19 @@ func (a *TaskAdaptor) BuildRequestBody(c *gin.Context, info *relaycommon.RelayIn
if
files
,
exists
:=
mf
.
File
[
"input_reference"
];
exists
&&
len
(
files
)
>
0
{
if
len
(
files
)
==
1
{
info
.
Action
=
constant
.
TaskActionGenerate
}
else
if
len
(
files
)
==
2
{
}
else
if
len
(
files
)
>
1
{
info
.
Action
=
constant
.
TaskActionFirstTailGenerate
}
else
if
len
(
files
)
>
2
{
info
.
Action
=
constant
.
TaskActionReferenceGenerate
}
// 将上传的文件转换为base64格式
var
images
[]
string
for
_
,
fileHeader
:=
range
files
{
// 检查文件大小
if
fileHeader
.
Size
>
MaxFileSize
{
return
nil
,
fmt
.
Errorf
(
"文件 %s 大小超过限制,最大允许 %d MB"
,
fileHeader
.
Filename
,
MaxFileSize
/
(
1024
*
1024
))
}
file
,
err
:=
fileHeader
.
Open
()
if
err
!=
nil
{
continue
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment