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
e9690c7a
authored
May 15, 2025
by
creamlike1024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add frontend display, more model
parent
5e8217db
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
6 deletions
+52
-6
relay/channel/coze/constants.go
+23
-1
relay/channel/coze/relay-coze.go
+6
-3
web/src/constants/channel.constants.js
+7
-2
web/src/pages/Channel/EditChannel.js
+16
-0
No files found.
relay/channel/coze/constants.go
View file @
e9690c7a
package
coze
package
coze
var
ModelList
=
[]
string
{
var
ModelList
=
[]
string
{
// TODO: 完整列表
"moonshot-v1-8k"
,
"moonshot-v1-32k"
,
"moonshot-v1-128k"
,
"Baichuan4"
,
"abab6.5s-chat-pro"
,
"glm-4-0520"
,
"qwen-max"
,
"deepseek-r1"
,
"deepseek-v3"
,
"deepseek-v3"
,
"deepseek-r1-distill-qwen-32b"
,
"deepseek-r1-distill-qwen-7b"
,
"step-1v-8k"
,
"step-1.5v-mini"
,
"Doubao-pro-32k"
,
"Doubao-pro-256k"
,
"Doubao-lite-128k"
,
"Doubao-lite-32k"
,
"Doubao-vision-lite-32k"
,
"Doubao-vision-pro-32k"
,
"Doubao-1.5-pro-vision-32k"
,
"Doubao-1.5-lite-32k"
,
"Doubao-1.5-pro-32k"
,
"Doubao-1.5-thinking-pro"
,
"Doubao-1.5-pro-256k"
,
}
}
var
ChannelName
=
"coze"
var
ChannelName
=
"coze"
relay/channel/coze/relay-coze.go
View file @
e9690c7a
...
@@ -28,10 +28,13 @@ func convertCozeChatRequest(c *gin.Context, request dto.GeneralOpenAIRequest) *C
...
@@ -28,10 +28,13 @@ func convertCozeChatRequest(c *gin.Context, request dto.GeneralOpenAIRequest) *C
})
})
}
}
}
}
user
:=
request
.
User
if
user
==
""
{
user
=
helper
.
GetResponseID
(
c
)
}
cozeRequest
:=
&
CozeChatRequest
{
cozeRequest
:=
&
CozeChatRequest
{
// TODO: model to botid
BotId
:
c
.
GetString
(
"bot_id"
),
BotId
:
c
.
GetString
(
"bot_id"
),
UserId
:
c
.
GetString
(
"id"
)
,
UserId
:
user
,
AdditionalMessages
:
messages
,
AdditionalMessages
:
messages
,
Stream
:
request
.
Stream
,
Stream
:
request
.
Stream
,
}
}
...
@@ -172,6 +175,6 @@ func doRequest(req *http.Request, info *common.RelayInfo) (*http.Response, error
...
@@ -172,6 +175,6 @@ func doRequest(req *http.Request, info *common.RelayInfo) (*http.Response, error
if
err
!=
nil
{
// 增加对 client.Do(req) 返回错误的检查
if
err
!=
nil
{
// 增加对 client.Do(req) 返回错误的检查
return
nil
,
fmt
.
Errorf
(
"client.Do failed: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"client.Do failed: %w"
,
err
)
}
}
_
=
resp
.
Body
.
Close
()
//
_ = resp.Body.Close()
return
resp
,
nil
return
resp
,
nil
}
}
web/src/constants/channel.constants.js
View file @
e9690c7a
...
@@ -118,6 +118,11 @@ export const CHANNEL_OPTIONS = [
...
@@ -118,6 +118,11 @@ export const CHANNEL_OPTIONS = [
{
{
value
:
48
,
value
:
48
,
color
:
'blue'
,
color
:
'blue'
,
label
:
'xAI'
label
:
'xAI'
,
}
},
{
value
:
49
,
color
:
'blue'
,
label
:
'Coze'
,
},
];
];
web/src/pages/Channel/EditChannel.js
View file @
e9690c7a
...
@@ -838,6 +838,22 @@ const EditChannel = (props) => {
...
@@ -838,6 +838,22 @@ const EditChannel = (props) => {
/>
/>
<
/
>
<
/
>
)}
)}
{
inputs
.
type
===
49
&&
(
<>
<
div
style
=
{{
marginTop
:
10
}}
>
<
Typography
.
Text
strong
>
智能体
ID
:
<
/Typography.Text
>
<
/div
>
<
Input
name
=
'other'
placeholder
=
{
'请输入智能体ID,例如:7342866812345'
}
onChange
=
{(
value
)
=>
{
handleInputChange
(
'other'
,
value
);
}}
value
=
{
inputs
.
other
}
autoComplete
=
'new-password'
/>
<
/
>
)}
<
div
style
=
{{
marginTop
:
10
}}
>
<
div
style
=
{{
marginTop
:
10
}}
>
<
Typography
.
Text
strong
>
{
t
(
'模型'
)}
:
<
/Typography.Text
>
<
Typography
.
Text
strong
>
{
t
(
'模型'
)}
:
<
/Typography.Text
>
<
/div
>
<
/div
>
...
...
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