修改讯飞星火定义

This commit is contained in:
Liujian
2024-10-16 14:52:44 +08:00
parent d27729d110
commit 21b2f554df
15 changed files with 34 additions and 219 deletions
@@ -87,4 +87,4 @@ provider_credential_schema:
placeholder:
en_US: A model you have access to (e.g. amazon.titan-text-lite-v1) for validation.
zh_Hans: 为了进行验证,请输入一个您可用的模型名称 (例如:amazon.titan-text-lite-v1)
address: https://api.openai.com
address: https://bedrock-runtime.amazonaws.com
@@ -39,4 +39,4 @@ provider_credential_schema:
placeholder:
zh_Hans: 在此输入您的 Secret Key
en_US: Enter your Secret Key
address: https://api.openai.com
address: https://hunyuan.tencentcloudapi.com
@@ -1,34 +0,0 @@
model: spark-1.5
deprecated: true
label:
en_US: Spark V1.5
model_type: llm
model_properties:
mode: chat
parameter_rules:
- name: temperature
use_template: temperature
default: 0.5
help:
zh_Hans: 核采样阈值。用于决定结果随机性,取值越高随机性越强即相同的问题得到的不同答案的可能性越高。
en_US: Kernel sampling threshold. Used to determine the randomness of the results. The higher the value, the stronger the randomness, that is, the higher the possibility of getting different answers to the same question.
- name: max_tokens
use_template: max_tokens
default: 512
min: 1
max: 4096
help:
zh_Hans: 模型回答的tokens的最大长度。
en_US: 模型回答的tokens的最大长度。
- name: top_k
label:
zh_Hans: 取样数量
en_US: Top k
type: int
default: 4
min: 1
max: 6
help:
zh_Hans: 从 k 个候选中随机选择一个(非等概率)。
en_US: Randomly select one from k candidates (non-equal probability).
required: false
@@ -1,34 +0,0 @@
model: spark-2
deprecated: true
label:
en_US: Spark V2.0
model_type: llm
model_properties:
mode: chat
parameter_rules:
- name: temperature
use_template: temperature
default: 0.5
help:
zh_Hans: 核采样阈值。用于决定结果随机性,取值越高随机性越强即相同的问题得到的不同答案的可能性越高。
en_US: Kernel sampling threshold. Used to determine the randomness of the results. The higher the value, the stronger the randomness, that is, the higher the possibility of getting different answers to the same question.
- name: max_tokens
use_template: max_tokens
default: 2048
min: 1
max: 8192
help:
zh_Hans: 模型回答的tokens的最大长度。
en_US: 模型回答的tokens的最大长度。
- name: top_k
label:
zh_Hans: 取样数量
en_US: Top k
type: int
default: 4
min: 1
max: 6
help:
zh_Hans: 从 k 个候选中随机选择一个(非等概率)。
en_US: Randomly select one from k candidates (non-equal probability).
required: false
@@ -1,34 +0,0 @@
model: spark-3.5
deprecated: true
label:
en_US: Spark V3.5
model_type: llm
model_properties:
mode: chat
parameter_rules:
- name: temperature
use_template: temperature
default: 0.5
help:
zh_Hans: 核采样阈值。用于决定结果随机性,取值越高随机性越强即相同的问题得到的不同答案的可能性越高。
en_US: Kernel sampling threshold. Used to determine the randomness of the results. The higher the value, the stronger the randomness, that is, the higher the possibility of getting different answers to the same question.
- name: max_tokens
use_template: max_tokens
default: 2048
min: 1
max: 8192
help:
zh_Hans: 模型回答的tokens的最大长度。
en_US: 模型回答的tokens的最大长度。
- name: top_k
label:
zh_Hans: 取样数量
en_US: Top k
type: int
default: 4
min: 1
max: 6
help:
zh_Hans: 从 k 个候选中随机选择一个(非等概率)。
en_US: Randomly select one from k candidates (non-equal probability).
required: false
@@ -1,34 +0,0 @@
model: spark-3
deprecated: true
label:
en_US: Spark V3.0
model_type: llm
model_properties:
mode: chat
parameter_rules:
- name: temperature
use_template: temperature
default: 0.5
help:
zh_Hans: 核采样阈值。用于决定结果随机性,取值越高随机性越强即相同的问题得到的不同答案的可能性越高。
en_US: Kernel sampling threshold. Used to determine the randomness of the results. The higher the value, the stronger the randomness, that is, the higher the possibility of getting different answers to the same question.
- name: max_tokens
use_template: max_tokens
default: 2048
min: 1
max: 8192
help:
zh_Hans: 模型回答的tokens的最大长度。
en_US: 模型回答的tokens的最大长度。
- name: top_k
label:
zh_Hans: 取样数量
en_US: Top k
type: int
default: 4
min: 1
max: 6
help:
zh_Hans: 从 k 个候选中随机选择一个(非等概率)。
en_US: Randomly select one from k candidates (non-equal probability).
required: false
@@ -1,4 +1,4 @@
model: spark-4.0-ultra
model: 4.0Ultra
label:
en_US: Spark 4.0 Ultra
model_type: llm
@@ -1,34 +0,0 @@
model: spark-4
deprecated: true
label:
en_US: Spark V4.0
model_type: llm
model_properties:
mode: chat
parameter_rules:
- name: temperature
use_template: temperature
default: 0.5
help:
zh_Hans: 核采样阈值。用于决定结果随机性,取值越高随机性越强即相同的问题得到的不同答案的可能性越高。
en_US: Kernel sampling threshold. Used to determine the randomness of the results. The higher the value, the stronger the randomness, that is, the higher the possibility of getting different answers to the same question.
- name: max_tokens
use_template: max_tokens
default: 4096
min: 1
max: 8192
help:
zh_Hans: 模型回答的tokens的最大长度。
en_US: 模型回答的tokens的最大长度。
- name: top_k
label:
zh_Hans: 取样数量
en_US: Top k
type: int
default: 4
min: 1
max: 6
help:
zh_Hans: 从 k 个候选中随机选择一个(非等概率)。
en_US: Randomly select one from k candidates (non-equal probability).
required: false
@@ -1,4 +1,4 @@
model: spark-lite
model: lite
label:
en_US: Spark Lite
model_type: llm
@@ -1,4 +1,4 @@
model: spark-max-32k
model: max-32k
label:
en_US: Spark Max-32K
model_type: llm
@@ -1,4 +1,4 @@
model: spark-max
model: generalv3.5
label:
en_US: Spark Max
model_type: llm
@@ -1,4 +1,4 @@
model: spark-pro-128k
model: pro-128k
label:
en_US: Spark Pro-128K
model_type: llm
@@ -1,4 +1,4 @@
model: spark-pro
model: generalv3
label:
en_US: Spark Pro
model_type: llm
@@ -20,28 +20,13 @@ configurate_methods:
- predefined-model
provider_credential_schema:
credential_form_schemas:
- variable: app_id
- variable: api_password
label:
en_US: APPID
type: text-input
required: true
placeholder:
zh_Hans: 在此输入您的 APPID
en_US: Enter your APPID
- variable: api_secret
label:
en_US: APISecret
en_US: APIPassword
type: secret-input
required: true
placeholder:
zh_Hans: 在此输入您的 APISecret
en_US: Enter your APISecret
- variable: api_key
label:
en_US: APIKey
type: secret-input
required: true
placeholder:
zh_Hans: 在此输入您的 APIKey
en_US: Enter your APIKey
address: https://api.openai.com
zh_Hans: 在此输入您的 APIPassword
en_US: Enter your APIPassword
address: https://spark-api-open.xf-yun.com
+20 -20
View File
@@ -3,6 +3,8 @@ package ai_api
import (
"context"
"fmt"
"net/http"
"github.com/APIParkLab/APIPark/model/plugin_model"
ai_api "github.com/APIParkLab/APIPark/module/ai-api"
ai_api_dto "github.com/APIParkLab/APIPark/module/ai-api/dto"
@@ -13,8 +15,6 @@ import (
"github.com/eolinker/go-common/store"
"github.com/gin-gonic/gin"
"github.com/google/uuid"
"net/http"
"strings"
)
var _ IAPIController = (*imlAPIController)(nil)
@@ -117,24 +117,24 @@ func (i *imlAPIController) Edit(ctx *gin.Context, serviceId string, apiId string
},
}
}
path := apiInfo.Path
if input.Path != nil {
inputPath := *input.Path
prefix, err := i.module.Prefix(ctx, serviceId)
if err != nil {
return err
}
if !strings.HasSuffix(inputPath, prefix) {
if inputPath[0] != '/' {
inputPath = fmt.Sprintf("/%s", inputPath)
}
path = fmt.Sprintf("%s%s", prefix, inputPath)
} else {
path = inputPath
}
}
proxy.Path = path
input.Path = &path
//path := apiInfo.Path
//if input.Path != nil {
// inputPath := *input.Path
// prefix, err := i.module.Prefix(ctx, serviceId)
// if err != nil {
// return err
// }
// if !strings.HasSuffix(inputPath, prefix) {
// if inputPath[0] != '/' {
// inputPath = fmt.Sprintf("/%s", inputPath)
// }
// path = fmt.Sprintf("%s%s", prefix, inputPath)
// } else {
// path = inputPath
// }
//}
//proxy.Path = path
//input.Path = &path
_, err = i.routerModule.Edit(ctx, serviceId, apiId, &router_dto.Edit{
Description: input.Description,
Proxy: proxy,