mirror of
https://github.com/langgenius/dify.git
synced 2026-04-28 03:36:36 +08:00
parameters and rules
This commit is contained in:
parent
2ed73b763d
commit
22696fa75b
@ -25,7 +25,7 @@ import { useSelectedDatasetsMode } from '@/app/components/workflow/nodes/knowled
|
|||||||
import Switch from '@/app/components/base/switch'
|
import Switch from '@/app/components/base/switch'
|
||||||
import Toast from '@/app/components/base/toast'
|
import Toast from '@/app/components/base/toast'
|
||||||
|
|
||||||
interface Props {
|
type Props = {
|
||||||
datasetConfigs: DatasetConfigs
|
datasetConfigs: DatasetConfigs
|
||||||
onChange: (configs: DatasetConfigs, isRetrievalModeChange?: boolean) => void
|
onChange: (configs: DatasetConfigs, isRetrievalModeChange?: boolean) => void
|
||||||
isInWorkflow?: boolean
|
isInWorkflow?: boolean
|
||||||
@ -71,6 +71,7 @@ const ConfigContent: FC<Props> = ({
|
|||||||
? {
|
? {
|
||||||
...rerankDefaultModel,
|
...rerankDefaultModel,
|
||||||
provider: rerankDefaultModel.provider.provider,
|
provider: rerankDefaultModel.provider.provider,
|
||||||
|
plugin_id: rerankDefaultModel.provider.plugin_id,
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
)
|
)
|
||||||
@ -80,12 +81,14 @@ const ConfigContent: FC<Props> = ({
|
|||||||
return {
|
return {
|
||||||
provider_name: datasetConfigs.reranking_model.reranking_provider_name,
|
provider_name: datasetConfigs.reranking_model.reranking_provider_name,
|
||||||
model_name: datasetConfigs.reranking_model.reranking_model_name,
|
model_name: datasetConfigs.reranking_model.reranking_model_name,
|
||||||
|
plugin_id: datasetConfigs.reranking_model.reranking_plugin_id,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (rerankDefaultModel) {
|
else if (rerankDefaultModel) {
|
||||||
return {
|
return {
|
||||||
provider_name: rerankDefaultModel.provider.provider,
|
provider_name: rerankDefaultModel.provider.provider,
|
||||||
model_name: rerankDefaultModel.model,
|
model_name: rerankDefaultModel.model,
|
||||||
|
plugin_id: rerankDefaultModel.provider.plugin_id,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
@ -172,7 +175,7 @@ const ConfigContent: FC<Props> = ({
|
|||||||
return false
|
return false
|
||||||
|
|
||||||
return datasetConfigs.reranking_enable
|
return datasetConfigs.reranking_enable
|
||||||
}, [canManuallyToggleRerank, datasetConfigs.reranking_enable])
|
}, [canManuallyToggleRerank, datasetConfigs.reranking_enable, isRerankDefaultModelValid])
|
||||||
|
|
||||||
const handleDisabledSwitchClick = useCallback(() => {
|
const handleDisabledSwitchClick = useCallback(() => {
|
||||||
if (!currentRerankModel && !showRerankModel)
|
if (!currentRerankModel && !showRerankModel)
|
||||||
@ -300,13 +303,14 @@ const ConfigContent: FC<Props> = ({
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<ModelSelector
|
<ModelSelector
|
||||||
defaultModel={rerankModel && { provider: rerankModel?.provider_name, model: rerankModel?.model_name }}
|
defaultModel={rerankModel && { provider: rerankModel?.provider_name, model: rerankModel?.model_name, plugin_id: rerankModel?.plugin_id }}
|
||||||
onSelect={(v) => {
|
onSelect={(v) => {
|
||||||
onChange({
|
onChange({
|
||||||
...datasetConfigs,
|
...datasetConfigs,
|
||||||
reranking_model: {
|
reranking_model: {
|
||||||
reranking_provider_name: v.provider,
|
reranking_provider_name: v.provider,
|
||||||
reranking_model_name: v.model,
|
reranking_model_name: v.model,
|
||||||
|
reranking_plugin_id: v.plugin_id,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
@ -384,6 +388,7 @@ const ConfigContent: FC<Props> = ({
|
|||||||
portalToFollowElemContentClassName='!z-[1002]'
|
portalToFollowElemContentClassName='!z-[1002]'
|
||||||
isAdvancedMode={true}
|
isAdvancedMode={true}
|
||||||
mode={model?.mode}
|
mode={model?.mode}
|
||||||
|
pluginId={model?.plugin_id}
|
||||||
provider={model?.provider}
|
provider={model?.provider}
|
||||||
completionParams={model?.completion_params}
|
completionParams={model?.completion_params}
|
||||||
modelId={model?.name}
|
modelId={model?.name}
|
||||||
|
|||||||
@ -36,12 +36,13 @@ const ModelParameterTrigger: FC<ModelParameterTriggerProps> = ({
|
|||||||
const language = useLanguage()
|
const language = useLanguage()
|
||||||
const index = multipleModelConfigs.findIndex(v => v.id === modelAndParameter.id)
|
const index = multipleModelConfigs.findIndex(v => v.id === modelAndParameter.id)
|
||||||
|
|
||||||
const handleSelectModel = ({ modelId, provider }: { modelId: string; provider: string }) => {
|
const handleSelectModel = ({ modelId, provider, pluginId }: { modelId: string; provider: string; pluginId: string }) => {
|
||||||
const newModelConfigs = [...multipleModelConfigs]
|
const newModelConfigs = [...multipleModelConfigs]
|
||||||
newModelConfigs[index] = {
|
newModelConfigs[index] = {
|
||||||
...newModelConfigs[index],
|
...newModelConfigs[index],
|
||||||
model: modelId,
|
model: modelId,
|
||||||
provider,
|
provider,
|
||||||
|
plugin_id: pluginId,
|
||||||
}
|
}
|
||||||
onMultipleModelConfigsChange(true, newModelConfigs)
|
onMultipleModelConfigsChange(true, newModelConfigs)
|
||||||
}
|
}
|
||||||
@ -58,6 +59,7 @@ const ModelParameterTrigger: FC<ModelParameterTriggerProps> = ({
|
|||||||
<ModelParameterModal
|
<ModelParameterModal
|
||||||
mode={mode}
|
mode={mode}
|
||||||
isAdvancedMode={isAdvancedMode}
|
isAdvancedMode={isAdvancedMode}
|
||||||
|
pluginId={modelAndParameter.plugin_id}
|
||||||
provider={modelAndParameter.provider}
|
provider={modelAndParameter.provider}
|
||||||
modelId={modelAndParameter.model}
|
modelId={modelAndParameter.model}
|
||||||
completionParams={modelAndParameter.parameters}
|
completionParams={modelAndParameter.parameters}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
export type ModelAndParameter = {
|
export type ModelAndParameter = {
|
||||||
id: string
|
id: string
|
||||||
model: string
|
model: string
|
||||||
|
plugin_id: string
|
||||||
provider: string
|
provider: string
|
||||||
parameters: Record<string, any>
|
parameters: Record<string, any>
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,7 +72,7 @@ import { SupportUploadFileTypes } from '@/app/components/workflow/types'
|
|||||||
import NewFeaturePanel from '@/app/components/base/features/new-feature-panel'
|
import NewFeaturePanel from '@/app/components/base/features/new-feature-panel'
|
||||||
import { fetchFileUploadConfig } from '@/service/common'
|
import { fetchFileUploadConfig } from '@/service/common'
|
||||||
|
|
||||||
interface PublishConfig {
|
type PublishConfig = {
|
||||||
modelConfig: ModelConfig
|
modelConfig: ModelConfig
|
||||||
completionParams: FormValue
|
completionParams: FormValue
|
||||||
}
|
}
|
||||||
@ -156,6 +156,7 @@ const Configuration: FC = () => {
|
|||||||
const setCompletionParams = (value: FormValue) => {
|
const setCompletionParams = (value: FormValue) => {
|
||||||
const params = { ...value }
|
const params = { ...value }
|
||||||
|
|
||||||
|
// eslint-disable-next-line ts/no-use-before-define
|
||||||
if ((!params.stop || params.stop.length === 0) && (modeModeTypeRef.current === ModelModeType.completion)) {
|
if ((!params.stop || params.stop.length === 0) && (modeModeTypeRef.current === ModelModeType.completion)) {
|
||||||
params.stop = getTempStop()
|
params.stop = getTempStop()
|
||||||
setTempStop([])
|
setTempStop([])
|
||||||
@ -164,6 +165,7 @@ const Configuration: FC = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const [modelConfig, doSetModelConfig] = useState<ModelConfig>({
|
const [modelConfig, doSetModelConfig] = useState<ModelConfig>({
|
||||||
|
plugin_id: 'langgenius',
|
||||||
provider: 'openai',
|
provider: 'openai',
|
||||||
model_id: 'gpt-3.5-turbo',
|
model_id: 'gpt-3.5-turbo',
|
||||||
mode: ModelModeType.unset,
|
mode: ModelModeType.unset,
|
||||||
@ -198,6 +200,7 @@ const Configuration: FC = () => {
|
|||||||
reranking_model: {
|
reranking_model: {
|
||||||
reranking_provider_name: '',
|
reranking_provider_name: '',
|
||||||
reranking_model_name: '',
|
reranking_model_name: '',
|
||||||
|
reranking_plugin_id: '',
|
||||||
},
|
},
|
||||||
top_k: DATASET_DEFAULT.top_k,
|
top_k: DATASET_DEFAULT.top_k,
|
||||||
score_threshold_enabled: false,
|
score_threshold_enabled: false,
|
||||||
@ -279,6 +282,7 @@ const Configuration: FC = () => {
|
|||||||
reranking_model: restConfigs.reranking_model && {
|
reranking_model: restConfigs.reranking_model && {
|
||||||
reranking_provider_name: restConfigs.reranking_model.reranking_provider_name,
|
reranking_provider_name: restConfigs.reranking_model.reranking_provider_name,
|
||||||
reranking_model_name: restConfigs.reranking_model.reranking_model_name,
|
reranking_model_name: restConfigs.reranking_model.reranking_model_name,
|
||||||
|
reranking_plugin_id: restConfigs.reranking_model.reranking_plugin_id,
|
||||||
},
|
},
|
||||||
retrieval_model,
|
retrieval_model,
|
||||||
score_threshold_enabled,
|
score_threshold_enabled,
|
||||||
@ -320,6 +324,7 @@ const Configuration: FC = () => {
|
|||||||
textGenerationModelList,
|
textGenerationModelList,
|
||||||
} = useTextGenerationCurrentProviderAndModelAndModelList(
|
} = useTextGenerationCurrentProviderAndModelAndModelList(
|
||||||
{
|
{
|
||||||
|
plugin_id: modelConfig.plugin_id,
|
||||||
provider: modelConfig.provider,
|
provider: modelConfig.provider,
|
||||||
model: modelConfig.model_id,
|
model: modelConfig.model_id,
|
||||||
},
|
},
|
||||||
@ -350,6 +355,7 @@ const Configuration: FC = () => {
|
|||||||
const [canReturnToSimpleMode, setCanReturnToSimpleMode] = useState(true)
|
const [canReturnToSimpleMode, setCanReturnToSimpleMode] = useState(true)
|
||||||
const setPromptMode = async (mode: PromptMode) => {
|
const setPromptMode = async (mode: PromptMode) => {
|
||||||
if (mode === PromptMode.advanced) {
|
if (mode === PromptMode.advanced) {
|
||||||
|
// eslint-disable-next-line ts/no-use-before-define
|
||||||
await migrateToDefaultPrompt()
|
await migrateToDefaultPrompt()
|
||||||
setCanReturnToSimpleMode(true)
|
setCanReturnToSimpleMode(true)
|
||||||
}
|
}
|
||||||
@ -545,6 +551,7 @@ const Configuration: FC = () => {
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
|
plugin_id: model.plugin_id,
|
||||||
provider: model.provider,
|
provider: model.provider,
|
||||||
model_id: model.name,
|
model_id: model.name,
|
||||||
mode: model.mode,
|
mode: model.mode,
|
||||||
@ -763,8 +770,8 @@ const Configuration: FC = () => {
|
|||||||
handleMultipleModelConfigsChange(
|
handleMultipleModelConfigsChange(
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
{ id: `${Date.now()}`, model: modelConfig.model_id, provider: modelConfig.provider, parameters: completionParams },
|
{ id: `${Date.now()}`, model: modelConfig.model_id, plugin_id: modelConfig.plugin_id, provider: modelConfig.provider, parameters: completionParams },
|
||||||
{ id: `${Date.now()}-no-repeat`, model: '', provider: '', parameters: {} },
|
{ id: `${Date.now()}-no-repeat`, model: '', plugin_id: '', provider: '', parameters: {} },
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
setAppSiderbarExpand('collapse')
|
setAppSiderbarExpand('collapse')
|
||||||
@ -886,6 +893,7 @@ const Configuration: FC = () => {
|
|||||||
<ModelParameterModal
|
<ModelParameterModal
|
||||||
isAdvancedMode={isAdvancedMode}
|
isAdvancedMode={isAdvancedMode}
|
||||||
mode={mode}
|
mode={mode}
|
||||||
|
pluginId={modelConfig.plugin_id}
|
||||||
provider={modelConfig.provider}
|
provider={modelConfig.provider}
|
||||||
completionParams={completionParams}
|
completionParams={completionParams}
|
||||||
modelId={modelConfig.model_id}
|
modelId={modelConfig.model_id}
|
||||||
|
|||||||
@ -38,8 +38,9 @@ export type ModelParameterModalProps = {
|
|||||||
isAdvancedMode: boolean
|
isAdvancedMode: boolean
|
||||||
mode: string
|
mode: string
|
||||||
modelId: string
|
modelId: string
|
||||||
|
pluginId: string
|
||||||
provider: string
|
provider: string
|
||||||
setModel: (model: { modelId: string; provider: string; mode?: string; features?: string[] }) => void
|
setModel: (model: { modelId: string; provider: string; pluginId: string; mode?: string; features?: string[] }) => void
|
||||||
completionParams: FormValue
|
completionParams: FormValue
|
||||||
onCompletionParamsChange: (newParams: FormValue) => void
|
onCompletionParamsChange: (newParams: FormValue) => void
|
||||||
hideDebugWithMultipleModel?: boolean
|
hideDebugWithMultipleModel?: boolean
|
||||||
@ -74,6 +75,7 @@ const ModelParameterModal: FC<ModelParameterModalProps> = ({
|
|||||||
portalToFollowElemContentClassName,
|
portalToFollowElemContentClassName,
|
||||||
isAdvancedMode,
|
isAdvancedMode,
|
||||||
modelId,
|
modelId,
|
||||||
|
pluginId,
|
||||||
provider,
|
provider,
|
||||||
setModel,
|
setModel,
|
||||||
completionParams,
|
completionParams,
|
||||||
@ -88,13 +90,17 @@ const ModelParameterModal: FC<ModelParameterModalProps> = ({
|
|||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const { isAPIKeySet } = useProviderContext()
|
const { isAPIKeySet } = useProviderContext()
|
||||||
const [open, setOpen] = useState(false)
|
const [open, setOpen] = useState(false)
|
||||||
const { data: parameterRulesData, isLoading } = useSWR((provider && modelId) ? `/workspaces/current/model-providers/${provider}/models/parameter-rules?model=${modelId}` : null, fetchModelParameterRules)
|
const { data: parameterRulesData, isLoading } = useSWR((provider && modelId) ? `/workspaces/current/model-providers/${pluginId}/${provider}/models/parameter-rules?model=${modelId}` : null, fetchModelParameterRules)
|
||||||
const {
|
const {
|
||||||
currentProvider,
|
currentProvider,
|
||||||
currentModel,
|
currentModel,
|
||||||
activeTextGenerationModelList,
|
activeTextGenerationModelList,
|
||||||
} = useTextGenerationCurrentProviderAndModelAndModelList(
|
} = useTextGenerationCurrentProviderAndModelAndModelList(
|
||||||
{ provider, model: modelId },
|
{
|
||||||
|
plugin_id: pluginId,
|
||||||
|
provider,
|
||||||
|
model: modelId,
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
const hasDeprecated = !currentProvider || !currentModel
|
const hasDeprecated = !currentProvider || !currentModel
|
||||||
@ -112,11 +118,12 @@ const ModelParameterModal: FC<ModelParameterModalProps> = ({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleChangeModel = ({ provider, model }: DefaultModel) => {
|
const handleChangeModel = ({ provider, model, plugin_id }: DefaultModel) => {
|
||||||
const targetProvider = activeTextGenerationModelList.find(modelItem => modelItem.provider === provider)
|
const targetProvider = activeTextGenerationModelList.find(modelItem => modelItem.provider === provider)
|
||||||
const targetModelItem = targetProvider?.models.find(modelItem => modelItem.model === model)
|
const targetModelItem = targetProvider?.models.find(modelItem => modelItem.model === model)
|
||||||
setModel({
|
setModel({
|
||||||
modelId: model,
|
modelId: model,
|
||||||
|
pluginId: plugin_id,
|
||||||
provider,
|
provider,
|
||||||
mode: targetModelItem?.model_properties.mode as string,
|
mode: targetModelItem?.model_properties.mode as string,
|
||||||
features: targetModelItem?.features || [],
|
features: targetModelItem?.features || [],
|
||||||
@ -201,7 +208,7 @@ const ModelParameterModal: FC<ModelParameterModalProps> = ({
|
|||||||
{t('common.modelProvider.model').toLocaleUpperCase()}
|
{t('common.modelProvider.model').toLocaleUpperCase()}
|
||||||
</div>
|
</div>
|
||||||
<ModelSelector
|
<ModelSelector
|
||||||
defaultModel={(provider || modelId) ? { provider, model: modelId } : undefined}
|
defaultModel={(provider || modelId) ? { plugin_id: pluginId, provider, model: modelId } : undefined}
|
||||||
modelList={activeTextGenerationModelList}
|
modelList={activeTextGenerationModelList}
|
||||||
onSelect={handleChangeModel}
|
onSelect={handleChangeModel}
|
||||||
triggerClassName='max-w-[295px]'
|
triggerClassName='max-w-[295px]'
|
||||||
|
|||||||
@ -41,11 +41,11 @@ const ModelSelector: FC<ModelSelectorProps> = ({
|
|||||||
defaultModel,
|
defaultModel,
|
||||||
)
|
)
|
||||||
|
|
||||||
const handleSelect = (provider: string, model: ModelItem) => {
|
const handleSelect = (pluginId: string, provider: string, model: ModelItem) => {
|
||||||
setOpen(false)
|
setOpen(false)
|
||||||
|
|
||||||
if (onSelect)
|
if (onSelect)
|
||||||
onSelect({ provider, model: model.model })
|
onSelect({ plugin_id: pluginId, provider, model: model.model })
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleToggle = () => {
|
const handleToggle = () => {
|
||||||
|
|||||||
@ -25,7 +25,7 @@ import Tooltip from '@/app/components/base/tooltip'
|
|||||||
type PopupItemProps = {
|
type PopupItemProps = {
|
||||||
defaultModel?: DefaultModel
|
defaultModel?: DefaultModel
|
||||||
model: Model
|
model: Model
|
||||||
onSelect: (provider: string, model: ModelItem) => void
|
onSelect: (pluginId: string, provider: string, model: ModelItem) => void
|
||||||
}
|
}
|
||||||
const PopupItem: FC<PopupItemProps> = ({
|
const PopupItem: FC<PopupItemProps> = ({
|
||||||
defaultModel,
|
defaultModel,
|
||||||
@ -39,11 +39,11 @@ const PopupItem: FC<PopupItemProps> = ({
|
|||||||
const updateModelList = useUpdateModelList()
|
const updateModelList = useUpdateModelList()
|
||||||
const updateModelProviders = useUpdateModelProviders()
|
const updateModelProviders = useUpdateModelProviders()
|
||||||
const currentProvider = modelProviders.find(provider => provider.provider === model.provider)!
|
const currentProvider = modelProviders.find(provider => provider.provider === model.provider)!
|
||||||
const handleSelect = (provider: string, modelItem: ModelItem) => {
|
const handleSelect = (pluginId: string, provider: string, modelItem: ModelItem) => {
|
||||||
if (modelItem.status !== ModelStatusEnum.active)
|
if (modelItem.status !== ModelStatusEnum.active)
|
||||||
return
|
return
|
||||||
|
|
||||||
onSelect(provider, modelItem)
|
onSelect(pluginId, provider, modelItem)
|
||||||
}
|
}
|
||||||
const handleOpenModelModal = () => {
|
const handleOpenModelModal = () => {
|
||||||
setShowModelModal({
|
setShowModelModal({
|
||||||
@ -80,7 +80,7 @@ const PopupItem: FC<PopupItemProps> = ({
|
|||||||
group relative flex items-center px-3 py-1.5 h-8 rounded-lg
|
group relative flex items-center px-3 py-1.5 h-8 rounded-lg
|
||||||
${modelItem.status === ModelStatusEnum.active ? 'cursor-pointer hover:bg-gray-50' : 'cursor-not-allowed hover:bg-gray-50/60'}
|
${modelItem.status === ModelStatusEnum.active ? 'cursor-pointer hover:bg-gray-50' : 'cursor-not-allowed hover:bg-gray-50/60'}
|
||||||
`}
|
`}
|
||||||
onClick={() => handleSelect(model.provider, modelItem)}
|
onClick={() => handleSelect(model.plugin_id, model.provider, modelItem)}
|
||||||
>
|
>
|
||||||
<ModelIcon
|
<ModelIcon
|
||||||
className={`
|
className={`
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import { XCircle } from '@/app/components/base/icons/src/vender/solid/general'
|
|||||||
type PopupProps = {
|
type PopupProps = {
|
||||||
defaultModel?: DefaultModel
|
defaultModel?: DefaultModel
|
||||||
modelList: Model[]
|
modelList: Model[]
|
||||||
onSelect: (provider: string, model: ModelItem) => void
|
onSelect: (pluginId: string, provider: string, model: ModelItem) => void
|
||||||
}
|
}
|
||||||
const Popup: FC<PopupProps> = ({
|
const Popup: FC<PopupProps> = ({
|
||||||
defaultModel,
|
defaultModel,
|
||||||
|
|||||||
@ -132,6 +132,7 @@ const Panel: FC<NodePanelProps<LLMNodeType>> = ({
|
|||||||
isInWorkflow
|
isInWorkflow
|
||||||
isAdvancedMode={true}
|
isAdvancedMode={true}
|
||||||
mode={model?.mode}
|
mode={model?.mode}
|
||||||
|
pluginId={model?.plugin_id}
|
||||||
provider={model?.provider}
|
provider={model?.provider}
|
||||||
completionParams={model?.completion_params}
|
completionParams={model?.completion_params}
|
||||||
modelId={model?.name}
|
modelId={model?.name}
|
||||||
|
|||||||
@ -123,7 +123,7 @@ const useConfig = (id: string, payload: LLMNodeType) => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const handleModelChanged = useCallback((model: { provider: string; modelId: string; mode?: string }) => {
|
const handleModelChanged = useCallback((model: { provider: string; modelId: string; pluginId: string; mode?: string }) => {
|
||||||
const newInputs = produce(inputRef.current, (draft) => {
|
const newInputs = produce(inputRef.current, (draft) => {
|
||||||
draft.model.provider = model.provider
|
draft.model.provider = model.provider
|
||||||
draft.model.name = model.modelId
|
draft.model.name = model.modelId
|
||||||
@ -139,6 +139,7 @@ const useConfig = (id: string, payload: LLMNodeType) => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (currentProvider?.provider && currentModel?.model && !model.provider) {
|
if (currentProvider?.provider && currentModel?.model && !model.provider) {
|
||||||
handleModelChanged({
|
handleModelChanged({
|
||||||
|
pluginId: currentProvider?.plugin_id,
|
||||||
provider: currentProvider?.provider,
|
provider: currentProvider?.provider,
|
||||||
modelId: currentModel?.model,
|
modelId: currentModel?.model,
|
||||||
mode: currentModel?.model_properties?.mode as string,
|
mode: currentModel?.model_properties?.mode as string,
|
||||||
|
|||||||
@ -77,6 +77,7 @@ const Panel: FC<NodePanelProps<ParameterExtractorNodeType>> = ({
|
|||||||
isInWorkflow
|
isInWorkflow
|
||||||
isAdvancedMode={true}
|
isAdvancedMode={true}
|
||||||
mode={model?.mode}
|
mode={model?.mode}
|
||||||
|
pluginId={model?.plugin_id}
|
||||||
provider={model?.provider}
|
provider={model?.provider}
|
||||||
completionParams={model?.completion_params}
|
completionParams={model?.completion_params}
|
||||||
modelId={model?.name}
|
modelId={model?.name}
|
||||||
|
|||||||
@ -65,6 +65,7 @@ const Panel: FC<NodePanelProps<QuestionClassifierNodeType>> = ({
|
|||||||
isInWorkflow
|
isInWorkflow
|
||||||
isAdvancedMode={true}
|
isAdvancedMode={true}
|
||||||
mode={model?.mode}
|
mode={model?.mode}
|
||||||
|
pluginId={model?.plugin_id}
|
||||||
provider={model?.provider}
|
provider={model?.provider}
|
||||||
completionParams={model.completion_params}
|
completionParams={model.completion_params}
|
||||||
modelId={model.name}
|
modelId={model.name}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import type { CommonNodeType, Memory, ModelConfig, ValueSelector, VisionSetting } from '@/app/components/workflow/types'
|
import type { CommonNodeType, Memory, ModelConfig, ValueSelector, VisionSetting } from '@/app/components/workflow/types'
|
||||||
|
|
||||||
export interface Topic {
|
export type Topic = {
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,7 +37,7 @@ export enum ControlMode {
|
|||||||
Hand = 'hand',
|
Hand = 'hand',
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Branch {
|
export type Branch = {
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
}
|
}
|
||||||
@ -68,7 +68,7 @@ export type CommonNodeType<T = {}> = {
|
|||||||
height?: number
|
height?: number
|
||||||
} & T & Partial<Pick<ToolDefaultValue, 'provider_id' | 'provider_type' | 'provider_name' | 'tool_name'>>
|
} & T & Partial<Pick<ToolDefaultValue, 'provider_id' | 'provider_type' | 'provider_name' | 'tool_name'>>
|
||||||
|
|
||||||
export interface CommonEdgeType {
|
export type CommonEdgeType = {
|
||||||
_hovering?: boolean
|
_hovering?: boolean
|
||||||
_connectedNodeIsHovering?: boolean
|
_connectedNodeIsHovering?: boolean
|
||||||
_connectedNodeIsSelected?: boolean
|
_connectedNodeIsSelected?: boolean
|
||||||
@ -82,14 +82,14 @@ export interface CommonEdgeType {
|
|||||||
|
|
||||||
export type Node<T = {}> = ReactFlowNode<CommonNodeType<T>>
|
export type Node<T = {}> = ReactFlowNode<CommonNodeType<T>>
|
||||||
export type SelectedNode = Pick<Node, 'id' | 'data'>
|
export type SelectedNode = Pick<Node, 'id' | 'data'>
|
||||||
export interface NodeProps<T = unknown> { id: string; data: CommonNodeType<T> }
|
export type NodeProps<T = unknown> = { id: string; data: CommonNodeType<T> }
|
||||||
export interface NodePanelProps<T> {
|
export type NodePanelProps<T> = {
|
||||||
id: string
|
id: string
|
||||||
data: CommonNodeType<T>
|
data: CommonNodeType<T>
|
||||||
}
|
}
|
||||||
export type Edge = ReactFlowEdge<CommonEdgeType>
|
export type Edge = ReactFlowEdge<CommonEdgeType>
|
||||||
|
|
||||||
export interface WorkflowDataUpdater {
|
export type WorkflowDataUpdater = {
|
||||||
nodes: Node[]
|
nodes: Node[]
|
||||||
edges: Edge[]
|
edges: Edge[]
|
||||||
viewport: Viewport
|
viewport: Viewport
|
||||||
@ -97,7 +97,7 @@ export interface WorkflowDataUpdater {
|
|||||||
|
|
||||||
export type ValueSelector = string[] // [nodeId, key | obj key path]
|
export type ValueSelector = string[] // [nodeId, key | obj key path]
|
||||||
|
|
||||||
export interface Variable {
|
export type Variable = {
|
||||||
variable: string
|
variable: string
|
||||||
label?: string | {
|
label?: string | {
|
||||||
nodeType: BlockEnum
|
nodeType: BlockEnum
|
||||||
@ -112,14 +112,14 @@ export interface Variable {
|
|||||||
isParagraph?: boolean
|
isParagraph?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EnvironmentVariable {
|
export type EnvironmentVariable = {
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
value: any
|
value: any
|
||||||
value_type: 'string' | 'number' | 'secret'
|
value_type: 'string' | 'number' | 'secret'
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ConversationVariable {
|
export type ConversationVariable = {
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
value_type: ChatVarType
|
value_type: ChatVarType
|
||||||
@ -127,13 +127,13 @@ export interface ConversationVariable {
|
|||||||
description: string
|
description: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GlobalVariable {
|
export type GlobalVariable = {
|
||||||
name: string
|
name: string
|
||||||
value_type: 'string' | 'number'
|
value_type: 'string' | 'number'
|
||||||
description: string
|
description: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface VariableWithValue {
|
export type VariableWithValue = {
|
||||||
key: string
|
key: string
|
||||||
value: string
|
value: string
|
||||||
}
|
}
|
||||||
@ -169,7 +169,8 @@ export type InputVar = {
|
|||||||
value_selector?: ValueSelector
|
value_selector?: ValueSelector
|
||||||
} & Partial<UploadFileSetting>
|
} & Partial<UploadFileSetting>
|
||||||
|
|
||||||
export interface ModelConfig {
|
export type ModelConfig = {
|
||||||
|
plugin_id: string
|
||||||
provider: string
|
provider: string
|
||||||
name: string
|
name: string
|
||||||
mode: string
|
mode: string
|
||||||
@ -187,7 +188,7 @@ export enum EditionType {
|
|||||||
jinja2 = 'jinja2',
|
jinja2 = 'jinja2',
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PromptItem {
|
export type PromptItem = {
|
||||||
id?: string
|
id?: string
|
||||||
role?: PromptRole
|
role?: PromptRole
|
||||||
text: string
|
text: string
|
||||||
@ -200,12 +201,12 @@ export enum MemoryRole {
|
|||||||
assistant = 'assistant',
|
assistant = 'assistant',
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RolePrefix {
|
export type RolePrefix = {
|
||||||
user: string
|
user: string
|
||||||
assistant: string
|
assistant: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Memory {
|
export type Memory = {
|
||||||
role_prefix?: RolePrefix
|
role_prefix?: RolePrefix
|
||||||
window: {
|
window: {
|
||||||
enabled: boolean
|
enabled: boolean
|
||||||
@ -229,7 +230,7 @@ export enum VarType {
|
|||||||
any = 'any',
|
any = 'any',
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Var {
|
export type Var = {
|
||||||
variable: string
|
variable: string
|
||||||
type: VarType
|
type: VarType
|
||||||
children?: Var[] // if type is obj, has the children struct
|
children?: Var[] // if type is obj, has the children struct
|
||||||
@ -240,21 +241,21 @@ export interface Var {
|
|||||||
des?: string
|
des?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface NodeOutPutVar {
|
export type NodeOutPutVar = {
|
||||||
nodeId: string
|
nodeId: string
|
||||||
title: string
|
title: string
|
||||||
vars: Var[]
|
vars: Var[]
|
||||||
isStartNode?: boolean
|
isStartNode?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Block {
|
export type Block = {
|
||||||
classification?: string
|
classification?: string
|
||||||
type: BlockEnum
|
type: BlockEnum
|
||||||
title: string
|
title: string
|
||||||
description?: string
|
description?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface NodeDefault<T> {
|
export type NodeDefault<T> = {
|
||||||
defaultValue: Partial<T>
|
defaultValue: Partial<T>
|
||||||
getAvailablePrevNodes: (isChatMode: boolean) => BlockEnum[]
|
getAvailablePrevNodes: (isChatMode: boolean) => BlockEnum[]
|
||||||
getAvailableNextNodes: (isChatMode: boolean) => BlockEnum[]
|
getAvailableNextNodes: (isChatMode: boolean) => BlockEnum[]
|
||||||
@ -294,19 +295,19 @@ export type OnNodeAdd = (
|
|||||||
}
|
}
|
||||||
) => void
|
) => void
|
||||||
|
|
||||||
export interface CheckValidRes {
|
export type CheckValidRes = {
|
||||||
isValid: boolean
|
isValid: boolean
|
||||||
errorMessage?: string
|
errorMessage?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RunFile {
|
export type RunFile = {
|
||||||
type: string
|
type: string
|
||||||
transfer_method: TransferMethod[]
|
transfer_method: TransferMethod[]
|
||||||
url?: string
|
url?: string
|
||||||
upload_file_id?: string
|
upload_file_id?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface WorkflowRunningData {
|
export type WorkflowRunningData = {
|
||||||
task_id?: string
|
task_id?: string
|
||||||
message_id?: string
|
message_id?: string
|
||||||
conversation_id?: string
|
conversation_id?: string
|
||||||
@ -331,7 +332,7 @@ export interface WorkflowRunningData {
|
|||||||
tracing?: NodeTracing[]
|
tracing?: NodeTracing[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface HistoryWorkflowData {
|
export type HistoryWorkflowData = {
|
||||||
id: string
|
id: string
|
||||||
sequence_number: number
|
sequence_number: number
|
||||||
status: string
|
status: string
|
||||||
@ -343,7 +344,7 @@ export enum ChangeType {
|
|||||||
remove = 'remove',
|
remove = 'remove',
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MoreInfo {
|
export type MoreInfo = {
|
||||||
type: ChangeType
|
type: ChangeType
|
||||||
payload?: {
|
payload?: {
|
||||||
beforeKey: string
|
beforeKey: string
|
||||||
@ -363,7 +364,7 @@ export enum SupportUploadFileTypes {
|
|||||||
custom = 'custom',
|
custom = 'custom',
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface UploadFileSetting {
|
export type UploadFileSetting = {
|
||||||
allowed_file_upload_methods: TransferMethod[]
|
allowed_file_upload_methods: TransferMethod[]
|
||||||
allowed_file_types: SupportUploadFileTypes[]
|
allowed_file_types: SupportUploadFileTypes[]
|
||||||
allowed_file_extensions?: string[]
|
allowed_file_extensions?: string[]
|
||||||
@ -371,7 +372,7 @@ export interface UploadFileSetting {
|
|||||||
number_limits?: number
|
number_limits?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface VisionSetting {
|
export type VisionSetting = {
|
||||||
variable_selector: ValueSelector
|
variable_selector: ValueSelector
|
||||||
detail: Resolution
|
detail: Resolution
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,25 +10,25 @@ export enum PromptMode {
|
|||||||
advanced = 'advanced',
|
advanced = 'advanced',
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PromptItem {
|
export type PromptItem = {
|
||||||
role?: PromptRole
|
role?: PromptRole
|
||||||
text: string
|
text: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ChatPromptConfig {
|
export type ChatPromptConfig = {
|
||||||
prompt: PromptItem[]
|
prompt: PromptItem[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ConversationHistoriesRole {
|
export type ConversationHistoriesRole = {
|
||||||
user_prefix: string
|
user_prefix: string
|
||||||
assistant_prefix: string
|
assistant_prefix: string
|
||||||
}
|
}
|
||||||
export interface CompletionPromptConfig {
|
export type CompletionPromptConfig = {
|
||||||
prompt: PromptItem
|
prompt: PromptItem
|
||||||
conversation_histories_role: ConversationHistoriesRole
|
conversation_histories_role: ConversationHistoriesRole
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BlockStatus {
|
export type BlockStatus = {
|
||||||
context: boolean
|
context: boolean
|
||||||
history: boolean
|
history: boolean
|
||||||
query: boolean
|
query: boolean
|
||||||
@ -40,7 +40,7 @@ export enum PromptRole {
|
|||||||
assistant = 'assistant',
|
assistant = 'assistant',
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PromptVariable {
|
export type PromptVariable = {
|
||||||
key: string
|
key: string
|
||||||
name: string
|
name: string
|
||||||
type: string // "string" | "number" | "select",
|
type: string // "string" | "number" | "select",
|
||||||
@ -55,7 +55,7 @@ export interface PromptVariable {
|
|||||||
icon_background?: string
|
icon_background?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CompletionParams {
|
export type CompletionParams = {
|
||||||
max_tokens: number
|
max_tokens: number
|
||||||
temperature: number
|
temperature: number
|
||||||
top_p: number
|
top_p: number
|
||||||
@ -66,12 +66,12 @@ export interface CompletionParams {
|
|||||||
|
|
||||||
export type ModelId = 'gpt-3.5-turbo' | 'text-davinci-003'
|
export type ModelId = 'gpt-3.5-turbo' | 'text-davinci-003'
|
||||||
|
|
||||||
export interface PromptConfig {
|
export type PromptConfig = {
|
||||||
prompt_template: string
|
prompt_template: string
|
||||||
prompt_variables: PromptVariable[]
|
prompt_variables: PromptVariable[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MoreLikeThisConfig {
|
export type MoreLikeThisConfig = {
|
||||||
enabled: boolean
|
enabled: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ export type SuggestedQuestionsAfterAnswerConfig = MoreLikeThisConfig
|
|||||||
|
|
||||||
export type SpeechToTextConfig = MoreLikeThisConfig
|
export type SpeechToTextConfig = MoreLikeThisConfig
|
||||||
|
|
||||||
export interface TextToSpeechConfig {
|
export type TextToSpeechConfig = {
|
||||||
enabled: boolean
|
enabled: boolean
|
||||||
voice?: string
|
voice?: string
|
||||||
language?: string
|
language?: string
|
||||||
@ -88,7 +88,7 @@ export interface TextToSpeechConfig {
|
|||||||
|
|
||||||
export type CitationConfig = MoreLikeThisConfig
|
export type CitationConfig = MoreLikeThisConfig
|
||||||
|
|
||||||
export interface AnnotationReplyConfig {
|
export type AnnotationReplyConfig = {
|
||||||
id: string
|
id: string
|
||||||
enabled: boolean
|
enabled: boolean
|
||||||
score_threshold: number
|
score_threshold: number
|
||||||
@ -98,7 +98,7 @@ export interface AnnotationReplyConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ModerationContentConfig {
|
export type ModerationContentConfig = {
|
||||||
enabled: boolean
|
enabled: boolean
|
||||||
preset_response?: string
|
preset_response?: string
|
||||||
}
|
}
|
||||||
@ -113,14 +113,15 @@ export type ModerationConfig = MoreLikeThisConfig & {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type RetrieverResourceConfig = MoreLikeThisConfig
|
export type RetrieverResourceConfig = MoreLikeThisConfig
|
||||||
export interface AgentConfig {
|
export type AgentConfig = {
|
||||||
enabled: boolean
|
enabled: boolean
|
||||||
strategy: AgentStrategy
|
strategy: AgentStrategy
|
||||||
max_iteration: number
|
max_iteration: number
|
||||||
tools: ToolItem[]
|
tools: ToolItem[]
|
||||||
}
|
}
|
||||||
// frontend use. Not the same as backend
|
// frontend use. Not the same as backend
|
||||||
export interface ModelConfig {
|
export type ModelConfig = {
|
||||||
|
plugin_id: string
|
||||||
provider: string // LLM Provider: for example "OPENAI"
|
provider: string // LLM Provider: for example "OPENAI"
|
||||||
model_id: string
|
model_id: string
|
||||||
mode: ModelModeType
|
mode: ModelModeType
|
||||||
@ -138,16 +139,17 @@ export interface ModelConfig {
|
|||||||
dataSets: any[]
|
dataSets: any[]
|
||||||
agentConfig: AgentConfig
|
agentConfig: AgentConfig
|
||||||
}
|
}
|
||||||
export interface DatasetConfigItem {
|
export type DatasetConfigItem = {
|
||||||
enable: boolean
|
enable: boolean
|
||||||
value: number
|
value: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DatasetConfigs {
|
export type DatasetConfigs = {
|
||||||
retrieval_model: RETRIEVE_TYPE
|
retrieval_model: RETRIEVE_TYPE
|
||||||
reranking_model: {
|
reranking_model: {
|
||||||
reranking_provider_name: string
|
reranking_provider_name: string
|
||||||
reranking_model_name: string
|
reranking_model_name: string
|
||||||
|
reranking_plugin_id: string
|
||||||
}
|
}
|
||||||
top_k: number
|
top_k: number
|
||||||
score_threshold_enabled: boolean
|
score_threshold_enabled: boolean
|
||||||
@ -172,39 +174,39 @@ export interface DatasetConfigs {
|
|||||||
reranking_enable?: boolean
|
reranking_enable?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DebugRequestBody {
|
export type DebugRequestBody = {
|
||||||
inputs: Inputs
|
inputs: Inputs
|
||||||
query: string
|
query: string
|
||||||
completion_params: CompletionParams
|
completion_params: CompletionParams
|
||||||
model_config: ModelConfig
|
model_config: ModelConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DebugResponse {
|
export type DebugResponse = {
|
||||||
id: string
|
id: string
|
||||||
answer: string
|
answer: string
|
||||||
created_at: string
|
created_at: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DebugResponseStream {
|
export type DebugResponseStream = {
|
||||||
id: string
|
id: string
|
||||||
data: string
|
data: string
|
||||||
created_at: string
|
created_at: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FeedBackRequestBody {
|
export type FeedBackRequestBody = {
|
||||||
message_id: string
|
message_id: string
|
||||||
rating: 'like' | 'dislike'
|
rating: 'like' | 'dislike'
|
||||||
content?: string
|
content?: string
|
||||||
from_source: 'api' | 'log'
|
from_source: 'api' | 'log'
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FeedBackResponse {
|
export type FeedBackResponse = {
|
||||||
message_id: string
|
message_id: string
|
||||||
rating: 'like' | 'dislike'
|
rating: 'like' | 'dislike'
|
||||||
}
|
}
|
||||||
|
|
||||||
// Log session list
|
// Log session list
|
||||||
export interface LogSessionListQuery {
|
export type LogSessionListQuery = {
|
||||||
keyword?: string
|
keyword?: string
|
||||||
start?: string // format datetime(YYYY-mm-dd HH:ii)
|
start?: string // format datetime(YYYY-mm-dd HH:ii)
|
||||||
end?: string // format datetime(YYYY-mm-dd HH:ii)
|
end?: string // format datetime(YYYY-mm-dd HH:ii)
|
||||||
@ -212,7 +214,7 @@ export interface LogSessionListQuery {
|
|||||||
limit: number // default 20. 1-100
|
limit: number // default 20. 1-100
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LogSessionListResponse {
|
export type LogSessionListResponse = {
|
||||||
data: {
|
data: {
|
||||||
id: string
|
id: string
|
||||||
conversation_id: string
|
conversation_id: string
|
||||||
@ -226,7 +228,7 @@ export interface LogSessionListResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// log session detail and debug
|
// log session detail and debug
|
||||||
export interface LogSessionDetailResponse {
|
export type LogSessionDetailResponse = {
|
||||||
id: string
|
id: string
|
||||||
conversation_id: string
|
conversation_id: string
|
||||||
model_provider: string
|
model_provider: string
|
||||||
@ -240,7 +242,7 @@ export interface LogSessionDetailResponse {
|
|||||||
from_source: 'api' | 'log'
|
from_source: 'api' | 'log'
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SavedMessage {
|
export type SavedMessage = {
|
||||||
id: string
|
id: string
|
||||||
answer: string
|
answer: string
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,13 +3,13 @@ import type { IOnCompleted, IOnData, IOnError, IOnFile, IOnMessageEnd, IOnMessag
|
|||||||
import type { ChatPromptConfig, CompletionPromptConfig } from '@/models/debug'
|
import type { ChatPromptConfig, CompletionPromptConfig } from '@/models/debug'
|
||||||
import type { ModelModeType } from '@/types/app'
|
import type { ModelModeType } from '@/types/app'
|
||||||
import type { ModelParameterRule } from '@/app/components/header/account-setting/model-provider-page/declarations'
|
import type { ModelParameterRule } from '@/app/components/header/account-setting/model-provider-page/declarations'
|
||||||
export interface AutomaticRes {
|
export type AutomaticRes = {
|
||||||
prompt: string
|
prompt: string
|
||||||
variables: string[]
|
variables: string[]
|
||||||
opening_statement: string
|
opening_statement: string
|
||||||
error?: string
|
error?: string
|
||||||
}
|
}
|
||||||
export interface CodeGenRes {
|
export type CodeGenRes = {
|
||||||
code: string
|
code: string
|
||||||
language: string[]
|
language: string[]
|
||||||
error?: string
|
error?: string
|
||||||
@ -82,8 +82,8 @@ export const generateRuleCode = (body: Record<string, any>) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const fetchModelParams = (providerName: string, modelId: string) => {
|
export const fetchModelParams = (pluginID: string, providerName: string, modelId: string) => {
|
||||||
return get(`workspaces/current/model-providers/${providerName}/models/parameter-rules`, {
|
return get(`workspaces/current/model-providers/${pluginID}/${providerName}/models/parameter-rules`, {
|
||||||
params: {
|
params: {
|
||||||
model: modelId,
|
model: modelId,
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user