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
6fddeb6d
authored
Jan 07, 2025
by
mango
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(channel model list): modify fetching model list in add channel to fetch by type
parent
d5e5b856
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletions
+3
-1
controller/channel.go
+2
-1
web/src/pages/Channel/EditChannel.js
+1
-0
No files found.
controller/channel.go
View file @
6fddeb6d
...
@@ -510,6 +510,7 @@ func UpdateChannel(c *gin.Context) {
...
@@ -510,6 +510,7 @@ func UpdateChannel(c *gin.Context) {
func
FetchModels
(
c
*
gin
.
Context
)
{
func
FetchModels
(
c
*
gin
.
Context
)
{
var
req
struct
{
var
req
struct
{
BaseURL
string
`json:"base_url"`
BaseURL
string
`json:"base_url"`
Type
int
`json:"type"`
Key
string
`json:"key"`
Key
string
`json:"key"`
}
}
...
@@ -523,7 +524,7 @@ func FetchModels(c *gin.Context) {
...
@@ -523,7 +524,7 @@ func FetchModels(c *gin.Context) {
baseURL
:=
req
.
BaseURL
baseURL
:=
req
.
BaseURL
if
baseURL
==
""
{
if
baseURL
==
""
{
baseURL
=
"https://api.openai.com"
baseURL
=
common
.
ChannelBaseURLs
[
req
.
Type
]
}
}
client
:=
&
http
.
Client
{}
client
:=
&
http
.
Client
{}
...
...
web/src/pages/Channel/EditChannel.js
View file @
6fddeb6d
...
@@ -218,6 +218,7 @@ const EditChannel = (props) => {
...
@@ -218,6 +218,7 @@ const EditChannel = (props) => {
try
{
try
{
const
res
=
await
API
.
post
(
'/api/channel/fetch_models'
,
{
const
res
=
await
API
.
post
(
'/api/channel/fetch_models'
,
{
base_url
:
inputs
[
'base_url'
],
base_url
:
inputs
[
'base_url'
],
type
:
inputs
[
'type'
],
key
:
inputs
[
'key'
]
key
:
inputs
[
'key'
]
});
});
...
...
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