feat(channel model list): modify fetching model list in add channel to fetch by type
This commit is contained in:
@@ -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) {
|
|||||||
|
|
||||||
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{}
|
||||||
|
|||||||
@@ -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']
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user