mirror of
https://github.com/langgenius/dify.git
synced 2026-05-03 17:08:03 +08:00
feat: agent checklist i18n
This commit is contained in:
@ -67,6 +67,7 @@ export const useChecklist = (nodes: Node[], edges: Edge[]) => {
|
||||
moreDataForCheckValid = {
|
||||
provider,
|
||||
strategy,
|
||||
language,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -19,19 +19,20 @@ const nodeDefault: NodeDefault<AgentNodeType> = {
|
||||
checkValid(payload, t, moreDataForCheckValid: {
|
||||
strategyProvider: StrategyPluginDetail | undefined,
|
||||
strategy: StrategyDetail | undefined
|
||||
language: string
|
||||
}) {
|
||||
const { strategy } = moreDataForCheckValid
|
||||
const { strategy, language } = moreDataForCheckValid
|
||||
if (!strategy) {
|
||||
return {
|
||||
isValid: false,
|
||||
errorMessage: 'Please select a strategy',
|
||||
errorMessage: t('workflow.checkList.strategyNotSelected'),
|
||||
}
|
||||
}
|
||||
for (const param of strategy.parameters) {
|
||||
if (param.required && !payload.agent_parameters?.[param.name]?.value) {
|
||||
return {
|
||||
isValid: false,
|
||||
errorMessage: `Please select ${param.name}`,
|
||||
errorMessage: t('workflow.errorMsg.fieldRequired', { field: param.label[language] }),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user