mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-04 02:31:27 +00:00
feat(ui): i18n for dynamic agent form fields
This commit is contained in:
parent
268b34774c
commit
1927d31e42
3 changed files with 38 additions and 7 deletions
|
|
@ -21,16 +21,20 @@ const DynamicAgentFormFields: React.FC<DynamicAgentFormFieldsProps> = ({ agentTy
|
|||
return (
|
||||
<>
|
||||
<Form.Item
|
||||
label="Agent Name"
|
||||
label={t("agentsPage.dynamicAgentFormFields.agentNameLabel")}
|
||||
name="agent_name"
|
||||
rules={[{ required: true, message: "Please enter a unique agent name" }]}
|
||||
tooltip="Unique identifier for the agent"
|
||||
rules={[{ required: true, message: t("agentsPage.dynamicAgentFormFields.agentNameRequired") }]}
|
||||
tooltip={t("agentsPage.dynamicAgentFormFields.agentNameTooltip")}
|
||||
>
|
||||
<Input placeholder="e.g., my-langgraph-agent" />
|
||||
<Input placeholder={t("agentsPage.dynamicAgentFormFields.agentNamePlaceholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="Description" name="description" tooltip="Brief description of what this agent does">
|
||||
<Input.TextArea rows={2} placeholder="Describe what this agent does..." />
|
||||
<Form.Item
|
||||
label={t("common.description")}
|
||||
name="description"
|
||||
tooltip={t("agentsPage.dynamicAgentFormFields.descriptionTooltip")}
|
||||
>
|
||||
<Input.TextArea rows={2} placeholder={t("agentsPage.dynamicAgentFormFields.descriptionPlaceholder")} />
|
||||
</Form.Item>
|
||||
|
||||
{agentTypeInfo.credential_fields.map((field: AgentCredentialFieldMetadata) => (
|
||||
|
|
@ -38,7 +42,16 @@ const DynamicAgentFormFields: React.FC<DynamicAgentFormFieldsProps> = ({ agentTy
|
|||
key={field.key}
|
||||
label={field.label}
|
||||
name={field.key}
|
||||
rules={field.required ? [{ required: true, message: `Please enter ${field.label}` }] : undefined}
|
||||
rules={
|
||||
field.required
|
||||
? [
|
||||
{
|
||||
required: true,
|
||||
message: t("agentsPage.dynamicAgentFormFields.credentialFieldRequired", { label: field.label }),
|
||||
},
|
||||
]
|
||||
: undefined
|
||||
}
|
||||
tooltip={field.tooltip}
|
||||
initialValue={field.default_value}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -6171,6 +6171,15 @@
|
|||
"editSettingsHint": "Click \"Edit Settings\" to modify agent configuration.",
|
||||
"rateLimitsTitle": "Rate Limits",
|
||||
"saveChanges": "Save Changes"
|
||||
},
|
||||
"dynamicAgentFormFields": {
|
||||
"agentNameLabel": "Agent Name",
|
||||
"agentNameRequired": "Please enter a unique agent name",
|
||||
"agentNameTooltip": "Unique identifier for the agent",
|
||||
"agentNamePlaceholder": "e.g., my-langgraph-agent",
|
||||
"descriptionTooltip": "Brief description of what this agent does",
|
||||
"descriptionPlaceholder": "Describe what this agent does...",
|
||||
"credentialFieldRequired": "Please enter {{label}}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6171,6 +6171,15 @@
|
|||
"editSettingsHint": "点击「编辑设置」修改 Agent 配置。",
|
||||
"rateLimitsTitle": "速率限制",
|
||||
"saveChanges": "保存更改"
|
||||
},
|
||||
"dynamicAgentFormFields": {
|
||||
"agentNameLabel": "Agent 名称",
|
||||
"agentNameRequired": "请输入唯一的 Agent 名称",
|
||||
"agentNameTooltip": "Agent 的唯一标识符",
|
||||
"agentNamePlaceholder": "例如:my-langgraph-agent",
|
||||
"descriptionTooltip": "简要描述该 Agent 的功能",
|
||||
"descriptionPlaceholder": "描述该 Agent 的功能...",
|
||||
"credentialFieldRequired": "请输入{{label}}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue