Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove unregistered-llm-in-debug #3251

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
model: ernie-3.5-8k
model: ernie-3.5-4k-0205
label:
en_US: Ernie-3.5-8K
en_US: Ernie-3.5-4k-0205
model_type: llm
features:
- agent-thought
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export type FormValue = Record<string, any>

export type TypeWithI18N<T = string> = {
'en-US': T
'zh-Hans': T
en_US: T
zh_Hans: T
[key: string]: T
}

Expand Down Expand Up @@ -67,16 +67,16 @@ export enum ModelStatusEnum {

export const MODEL_STATUS_TEXT: { [k: string]: TypeWithI18N } = {
'no-configure': {
'en-US': 'No Configure',
'zh-Hans': '未配置凭据',
en_US: 'No Configure',
zh_Hans: '未配置凭据',
},
'quota-exceeded': {
'en-US': 'Quota Exceeded',
'zh-Hans': '额度不足',
en_US: 'Quota Exceeded',
zh_Hans: '额度不足',
},
'no-permission': {
'en-US': 'No Permission',
'zh-Hans': '无使用权限',
en_US: 'No Permission',
zh_Hans: '无使用权限',
},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import type {
DefaultModel,
DefaultModelResponse,
Model,

ModelTypeEnum,
} from './declarations'
import {
ConfigurateMethodEnum,
ModelStatusEnum,
} from './declarations'
import I18n from '@/context/i18n'
import {
Expand Down Expand Up @@ -132,6 +132,7 @@ export const useCurrentProviderAndModel = (modelList: Model[], defaultModel?: De

export const useTextGenerationCurrentProviderAndModelAndModelList = (defaultModel?: DefaultModel) => {
const { textGenerationModelList } = useProviderContext()
const activeTextGenerationModelList = textGenerationModelList.filter(model => model.status === ModelStatusEnum.active)
const {
currentProvider,
currentModel,
Expand All @@ -141,6 +142,7 @@ export const useTextGenerationCurrentProviderAndModelAndModelList = (defaultMode
currentProvider,
currentModel,
textGenerationModelList,
activeTextGenerationModelList,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const ModelParameterModal: FC<ModelParameterModalProps> = ({
const {
currentProvider,
currentModel,
textGenerationModelList,
activeTextGenerationModelList,
} = useTextGenerationCurrentProviderAndModelAndModelList(
{ provider, model: modelId },
)
Expand All @@ -114,7 +114,7 @@ const ModelParameterModal: FC<ModelParameterModalProps> = ({
}

const handleChangeModel = ({ provider, model }: DefaultModel) => {
const targetProvider = textGenerationModelList.find(modelItem => modelItem.provider === provider)
const targetProvider = activeTextGenerationModelList.find(modelItem => modelItem.provider === provider)
const targetModelItem = targetProvider?.models.find(modelItem => modelItem.model === model)
setModel({
modelId: model,
Expand Down Expand Up @@ -223,7 +223,7 @@ const ModelParameterModal: FC<ModelParameterModalProps> = ({
</div>
<ModelSelector
defaultModel={(provider || modelId) ? { provider, model: modelId } : undefined}
modelList={textGenerationModelList}
modelList={activeTextGenerationModelList}
onSelect={handleChangeModel}
/>
</div>
Expand Down
Loading