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
deff59a5
authored
Mar 22, 2026
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: increase StreamScannerMaxBufferMB limit and add handling for gpt-5.4-nano prefix
parent
3c516084
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletions
+4
-1
common/init.go
+1
-1
setting/ratio_setting/model_ratio.go
+3
-0
No files found.
common/init.go
View file @
deff59a5
...
...
@@ -131,7 +131,7 @@ func initConstantEnv() {
constant
.
StreamingTimeout
=
GetEnvOrDefault
(
"STREAMING_TIMEOUT"
,
300
)
constant
.
DifyDebug
=
GetEnvOrDefaultBool
(
"DIFY_DEBUG"
,
true
)
constant
.
MaxFileDownloadMB
=
GetEnvOrDefault
(
"MAX_FILE_DOWNLOAD_MB"
,
64
)
constant
.
StreamScannerMaxBufferMB
=
GetEnvOrDefault
(
"STREAM_SCANNER_MAX_BUFFER_MB"
,
64
)
constant
.
StreamScannerMaxBufferMB
=
GetEnvOrDefault
(
"STREAM_SCANNER_MAX_BUFFER_MB"
,
128
)
// MaxRequestBodyMB 请求体最大大小(解压后),用于防止超大请求/zip bomb导致内存暴涨
constant
.
MaxRequestBodyMB
=
GetEnvOrDefault
(
"MAX_REQUEST_BODY_MB"
,
128
)
// ForceStreamOption 覆盖请求参数,强制返回usage信息
...
...
setting/ratio_setting/model_ratio.go
View file @
deff59a5
...
...
@@ -510,6 +510,9 @@ func getHardcodedCompletionModelRatio(name string) (float64, bool) {
// gpt-5 匹配
if
strings
.
HasPrefix
(
name
,
"gpt-5"
)
{
if
strings
.
HasPrefix
(
name
,
"gpt-5.4"
)
{
if
strings
.
HasPrefix
(
name
,
"gpt-5.4-nano"
)
{
return
6.25
,
true
}
return
6
,
true
}
return
8
,
true
...
...
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