mirror of
https://github.com/APIParkLab/APIPark.git
synced 2026-06-14 20:41:15 +08:00
Merge pull request #258 from APIParkLab/feature/1.6-cx
feat: feature/1.6-Integrate custom model
This commit is contained in:
@@ -283,8 +283,9 @@ const AiSettingModalContent = forwardRef<AiSettingModalContentHandle, AiSettingM
|
||||
),
|
||||
onOk: () => {
|
||||
return addModelModalRef.current?.save().then((res) => {
|
||||
if (res === true) {
|
||||
if (res) {
|
||||
getLlmList(lastLlmID)
|
||||
form.setFieldValue('defaultLlm', res)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -102,7 +102,7 @@ const AddModels = forwardRef<addModelsContentHandle, addModelContentProps>((prop
|
||||
...value,
|
||||
id: modelID
|
||||
}
|
||||
fetchData<BasicResponse<null>>('ai/provider/model', {
|
||||
fetchData<BasicResponse<{ model: { id: string, name: string } }>>('ai/provider/model', {
|
||||
method: type === 'edit' ? 'PUT' : 'POST',
|
||||
eoParams: { provider: providerID },
|
||||
eoBody: finalValue,
|
||||
@@ -112,7 +112,8 @@ const AddModels = forwardRef<addModelsContentHandle, addModelContentProps>((prop
|
||||
const { code, msg } = response
|
||||
if (code === STATUS_CODE.SUCCESS) {
|
||||
message.success($t(RESPONSE_TIPS.success) || msg)
|
||||
resolve(true)
|
||||
const llmId = response.data?.model?.id
|
||||
resolve(llmId)
|
||||
} else {
|
||||
message.error(msg || $t(RESPONSE_TIPS.error))
|
||||
reject(msg || $t(RESPONSE_TIPS.error))
|
||||
|
||||
Reference in New Issue
Block a user