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
b843c356
authored
May 09, 2025
by
creamlike1024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: change azure default api version to 2025-04-01-preview
parent
f8a972da
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
13 deletions
+26
-13
README.en.md
+1
-1
README.md
+1
-1
constant/env.go
+1
-1
web/src/i18n/locales/en.json
+1
-1
web/src/pages/Channel/EditChannel.js
+22
-9
No files found.
README.en.md
View file @
b843c356
...
@@ -107,7 +107,7 @@ For detailed configuration instructions, please refer to [Installation Guide-Env
...
@@ -107,7 +107,7 @@ For detailed configuration instructions, please refer to [Installation Guide-Env
-
`GEMINI_VISION_MAX_IMAGE_NUM`
: Maximum number of images for Gemini models, default is
`16`
-
`GEMINI_VISION_MAX_IMAGE_NUM`
: Maximum number of images for Gemini models, default is
`16`
-
`MAX_FILE_DOWNLOAD_MB`
: Maximum file download size in MB, default is
`20`
-
`MAX_FILE_DOWNLOAD_MB`
: Maximum file download size in MB, default is
`20`
-
`CRYPTO_SECRET`
: Encryption key used for encrypting database content
-
`CRYPTO_SECRET`
: Encryption key used for encrypting database content
-
`AZURE_DEFAULT_API_VERSION`
: Azure channel default API version, default is
`202
4-12
-01-preview`
-
`AZURE_DEFAULT_API_VERSION`
: Azure channel default API version, default is
`202
5-04
-01-preview`
-
`NOTIFICATION_LIMIT_DURATION_MINUTE`
: Notification limit duration, default is
`10`
minutes
-
`NOTIFICATION_LIMIT_DURATION_MINUTE`
: Notification limit duration, default is
`10`
minutes
-
`NOTIFY_LIMIT_COUNT`
: Maximum number of user notifications within the specified duration, default is
`2`
-
`NOTIFY_LIMIT_COUNT`
: Maximum number of user notifications within the specified duration, default is
`2`
...
...
README.md
View file @
b843c356
...
@@ -107,7 +107,7 @@ New API提供了丰富的功能,详细特性请参考[特性说明](https://do
...
@@ -107,7 +107,7 @@ New API提供了丰富的功能,详细特性请参考[特性说明](https://do
-
`GEMINI_VISION_MAX_IMAGE_NUM`
:Gemini模型最大图片数量,默认
`16`
-
`GEMINI_VISION_MAX_IMAGE_NUM`
:Gemini模型最大图片数量,默认
`16`
-
`MAX_FILE_DOWNLOAD_MB`
: 最大文件下载大小,单位MB,默认
`20`
-
`MAX_FILE_DOWNLOAD_MB`
: 最大文件下载大小,单位MB,默认
`20`
-
`CRYPTO_SECRET`
:加密密钥,用于加密数据库内容
-
`CRYPTO_SECRET`
:加密密钥,用于加密数据库内容
-
`AZURE_DEFAULT_API_VERSION`
:Azure渠道默认API版本,默认
`202
4-12
-01-preview`
-
`AZURE_DEFAULT_API_VERSION`
:Azure渠道默认API版本,默认
`202
5-04
-01-preview`
-
`NOTIFICATION_LIMIT_DURATION_MINUTE`
:通知限制持续时间,默认
`10`
分钟
-
`NOTIFICATION_LIMIT_DURATION_MINUTE`
:通知限制持续时间,默认
`10`
分钟
-
`NOTIFY_LIMIT_COUNT`
:用户通知在指定持续时间内的最大数量,默认
`2`
-
`NOTIFY_LIMIT_COUNT`
:用户通知在指定持续时间内的最大数量,默认
`2`
...
...
constant/env.go
View file @
b843c356
...
@@ -31,7 +31,7 @@ func InitEnv() {
...
@@ -31,7 +31,7 @@ func InitEnv() {
GetMediaToken
=
common
.
GetEnvOrDefaultBool
(
"GET_MEDIA_TOKEN"
,
true
)
GetMediaToken
=
common
.
GetEnvOrDefaultBool
(
"GET_MEDIA_TOKEN"
,
true
)
GetMediaTokenNotStream
=
common
.
GetEnvOrDefaultBool
(
"GET_MEDIA_TOKEN_NOT_STREAM"
,
true
)
GetMediaTokenNotStream
=
common
.
GetEnvOrDefaultBool
(
"GET_MEDIA_TOKEN_NOT_STREAM"
,
true
)
UpdateTask
=
common
.
GetEnvOrDefaultBool
(
"UPDATE_TASK"
,
true
)
UpdateTask
=
common
.
GetEnvOrDefaultBool
(
"UPDATE_TASK"
,
true
)
AzureDefaultAPIVersion
=
common
.
GetEnvOrDefaultString
(
"AZURE_DEFAULT_API_VERSION"
,
"202
4-12
-01-preview"
)
AzureDefaultAPIVersion
=
common
.
GetEnvOrDefaultString
(
"AZURE_DEFAULT_API_VERSION"
,
"202
5-04
-01-preview"
)
GeminiVisionMaxImageNum
=
common
.
GetEnvOrDefault
(
"GEMINI_VISION_MAX_IMAGE_NUM"
,
16
)
GeminiVisionMaxImageNum
=
common
.
GetEnvOrDefault
(
"GEMINI_VISION_MAX_IMAGE_NUM"
,
16
)
NotifyLimitCount
=
common
.
GetEnvOrDefault
(
"NOTIFY_LIMIT_COUNT"
,
2
)
NotifyLimitCount
=
common
.
GetEnvOrDefault
(
"NOTIFY_LIMIT_COUNT"
,
2
)
NotificationLimitDurationMinute
=
common
.
GetEnvOrDefault
(
"NOTIFICATION_LIMIT_DURATION_MINUTE"
,
10
)
NotificationLimitDurationMinute
=
common
.
GetEnvOrDefault
(
"NOTIFICATION_LIMIT_DURATION_MINUTE"
,
10
)
...
...
web/src/i18n/locales/en.json
View file @
b843c356
...
@@ -1086,7 +1086,7 @@
...
@@ -1086,7 +1086,7 @@
"没有账户?"
:
"No account? "
,
"没有账户?"
:
"No account? "
,
"请输入 AZURE_OPENAI_ENDPOINT,例如:https://docs-test-001.openai.azure.com"
:
"Please enter AZURE_OPENAI_ENDPOINT, e.g.: https://docs-test-001.openai.azure.com"
,
"请输入 AZURE_OPENAI_ENDPOINT,例如:https://docs-test-001.openai.azure.com"
:
"Please enter AZURE_OPENAI_ENDPOINT, e.g.: https://docs-test-001.openai.azure.com"
,
"默认 API 版本"
:
"Default API Version"
,
"默认 API 版本"
:
"Default API Version"
,
"请输入默认 API 版本,例如:202
4-12-01-preview"
:
"Please enter default API version, e.g.: 2024-12
-01-preview."
,
"请输入默认 API 版本,例如:202
5-04-01-preview"
:
"Please enter default API version, e.g.: 2025-04
-01-preview."
,
"请为渠道命名"
:
"Please name the channel"
,
"请为渠道命名"
:
"Please name the channel"
,
"请选择可以使用该渠道的分组"
:
"Please select groups that can use this channel"
,
"请选择可以使用该渠道的分组"
:
"Please select groups that can use this channel"
,
"请在系统设置页面编辑分组倍率以添加新的分组:"
:
"Please edit Group ratios in system settings to add new groups:"
,
"请在系统设置页面编辑分组倍率以添加新的分组:"
:
"Please edit Group ratios in system settings to add new groups:"
,
...
...
web/src/pages/Channel/EditChannel.js
View file @
b843c356
...
@@ -24,7 +24,8 @@ import {
...
@@ -24,7 +24,8 @@ import {
TextArea
,
TextArea
,
Checkbox
,
Checkbox
,
Banner
,
Banner
,
Modal
,
ImagePreview
Modal
,
ImagePreview
,
}
from
'@douyinfe/semi-ui'
;
}
from
'@douyinfe/semi-ui'
;
import
{
getChannelModels
,
loadChannelModels
}
from
'../../components/utils.js'
;
import
{
getChannelModels
,
loadChannelModels
}
from
'../../components/utils.js'
;
import
{
IconHelpCircle
}
from
'@douyinfe/semi-icons'
;
import
{
IconHelpCircle
}
from
'@douyinfe/semi-icons'
;
...
@@ -306,7 +307,7 @@ const EditChannel = (props) => {
...
@@ -306,7 +307,7 @@ const EditChannel = (props) => {
fetchModels
().
then
();
fetchModels
().
then
();
fetchGroups
().
then
();
fetchGroups
().
then
();
if
(
isEdit
)
{
if
(
isEdit
)
{
loadChannel
().
then
(()
=>
{
});
loadChannel
().
then
(()
=>
{});
}
else
{
}
else
{
setInputs
(
originInputs
);
setInputs
(
originInputs
);
let
localModels
=
getChannelModels
(
inputs
.
type
);
let
localModels
=
getChannelModels
(
inputs
.
type
);
...
@@ -477,7 +478,9 @@ const EditChannel = (props) => {
...
@@ -477,7 +478,9 @@ const EditChannel = (props) => {
type
=
{
'warning'
}
type
=
{
'warning'
}
description
=
{
description
=
{
<>
<>
{
t
(
'2025年5月10日后添加的渠道,不需要再在部署的时候移除模型名称中的"."'
)}
{
t
(
'2025年5月10日后添加的渠道,不需要再在部署的时候移除模型名称中的"."'
,
)}
{
/*<br />*/
}
{
/*<br />*/
}
{
/*<Typography.Text*/
}
{
/*<Typography.Text*/
}
{
/* style={{*/
}
{
/* style={{*/
}
...
@@ -522,7 +525,7 @@ const EditChannel = (props) => {
...
@@ -522,7 +525,7 @@ const EditChannel = (props) => {
<
Input
<
Input
label
=
{
t
(
'默认 API 版本'
)}
label
=
{
t
(
'默认 API 版本'
)}
name
=
'azure_other'
name
=
'azure_other'
placeholder
=
{
t
(
'请输入默认 API 版本,例如:202
4-12
-01-preview'
)}
placeholder
=
{
t
(
'请输入默认 API 版本,例如:202
5-04
-01-preview'
)}
onChange
=
{(
value
)
=>
{
onChange
=
{(
value
)
=>
{
handleInputChange
(
'other'
,
value
);
handleInputChange
(
'other'
,
value
);
}}
}}
...
@@ -584,21 +587,31 @@ const EditChannel = (props) => {
...
@@ -584,21 +587,31 @@ const EditChannel = (props) => {
value
=
{
inputs
.
name
}
value
=
{
inputs
.
name
}
autoComplete
=
'new-password'
autoComplete
=
'new-password'
/>
/>
{
inputs
.
type
!==
3
&&
inputs
.
type
!==
8
&&
inputs
.
type
!==
22
&&
inputs
.
type
!==
36
&&
inputs
.
type
!==
45
&&
(
{
inputs
.
type
!==
3
&&
inputs
.
type
!==
8
&&
inputs
.
type
!==
22
&&
inputs
.
type
!==
36
&&
inputs
.
type
!==
45
&&
(
<>
<>
<
div
style
=
{{
marginTop
:
10
}}
>
<
div
style
=
{{
marginTop
:
10
}}
>
<
Typography
.
Text
strong
>
{
t
(
'API地址'
)}
:
<
/Typography.Text
>
<
Typography
.
Text
strong
>
{
t
(
'API地址'
)}
:
<
/Typography.Text
>
<
/div
>
<
/div
>
<
Tooltip
content
=
{
t
(
'对于官方渠道,new-api已经内置地址,除非是第三方代理站点或者Azure的特殊接入地址,否则不需要填写'
)}
>
<
Tooltip
content
=
{
t
(
'对于官方渠道,new-api已经内置地址,除非是第三方代理站点或者Azure的特殊接入地址,否则不需要填写'
,
)}
>
<
Input
<
Input
label
=
{
t
(
'API地址'
)}
label
=
{
t
(
'API地址'
)}
name
=
"base_url"
name
=
'base_url'
placeholder
=
{
t
(
'此项可选,用于通过自定义API地址来进行 API 调用,末尾不要带/v1和/'
)}
placeholder
=
{
t
(
'此项可选,用于通过自定义API地址来进行 API 调用,末尾不要带/v1和/'
,
)}
onChange
=
{(
value
)
=>
{
onChange
=
{(
value
)
=>
{
handleInputChange
(
'base_url'
,
value
);
handleInputChange
(
'base_url'
,
value
);
}}
}}
value
=
{
inputs
.
base_url
}
value
=
{
inputs
.
base_url
}
autoComplete
=
"new-password"
autoComplete
=
'new-password'
/>
/>
<
/Tooltip
>
<
/Tooltip
>
<
/
>
<
/
>
...
...
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