🔖 chore: Replace API version in request URL
This commit is contained in:
parent
fc51dffaca
commit
7ddeada284
@ -102,6 +102,8 @@ func (p *OpenAIProvider) GetFullRequestURL(requestURL string, modelName string)
|
|||||||
requestURL = fmt.Sprintf("/openai%s?api-version=%s", requestURL, apiVersion)
|
requestURL = fmt.Sprintf("/openai%s?api-version=%s", requestURL, apiVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if p.Channel.Type == common.ChannelTypeCustom && p.Channel.Other != "" {
|
||||||
|
requestURL = strings.Replace(requestURL, "v1", p.Channel.Other, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.HasPrefix(baseURL, "https://gateway.ai.cloudflare.com") {
|
if strings.HasPrefix(baseURL, "https://gateway.ai.cloudflare.com") {
|
||||||
|
@ -153,7 +153,8 @@ const EditModal = ({ open, channelId, onCancel, onOk, groupOptions }) => {
|
|||||||
const res = await API.post(`/api/channel/provider_models_list`, { ...values, models: '' });
|
const res = await API.post(`/api/channel/provider_models_list`, { ...values, models: '' });
|
||||||
const { success, message, data } = res.data;
|
const { success, message, data } = res.data;
|
||||||
if (success && data) {
|
if (success && data) {
|
||||||
let modelList = data.map((model) => {
|
let uniqueModels = Array.from(new Set(data));
|
||||||
|
let modelList = uniqueModels.map((model) => {
|
||||||
return {
|
return {
|
||||||
id: model,
|
id: model,
|
||||||
group: '自定义:点击或回车输入'
|
group: '自定义:点击或回车输入'
|
||||||
|
@ -54,7 +54,11 @@ const typeConfig = {
|
|||||||
},
|
},
|
||||||
8: {
|
8: {
|
||||||
inputLabel: {
|
inputLabel: {
|
||||||
provider_models_list: '从渠道获取模型列表'
|
provider_models_list: '从渠道获取模型列表',
|
||||||
|
other: '替换 API 版本'
|
||||||
|
},
|
||||||
|
prompt: {
|
||||||
|
other: '输入后,会替换请求地址中的v1,例如:freeapi,则请求chat时会变成https://xxx.com/freeapi/chat/completions'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
3: {
|
3: {
|
||||||
|
Loading…
Reference in New Issue
Block a user