chore: add model select mock

This commit is contained in:
AkaraChen 2024-12-25 15:06:58 +08:00
parent a7b2f9aef0
commit e0f83d06d8
1 changed files with 10 additions and 224 deletions

View File

@ -7,7 +7,9 @@ import Slider from '@/app/components/base/slider'
import { AgentStrategy } from '../_base/components/agent-strategy'
import useConfig from './use-config'
import { useTranslation } from 'react-i18next'
import { type CredentialFormSchema, FormTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations'
// @ts-expect-error fuck
const mockSchema = [
{
name: 'format',
@ -17,20 +19,12 @@ const mockSchema = [
pt_BR: 'Format',
ja_JP: 'Format',
},
placeholder: null,
scope: null,
placeholder: undefined,
scope: undefined,
required: false,
default: '%Y-%m-%d %H:%M:%S',
min: null,
max: null,
options: [],
type: 'text-input',
human_description: {
en_US: 'Time format in strftime standard.',
zh_Hans: 'strftime 标准的时间格式。',
pt_BR: 'Time format in strftime standard.',
ja_JP: 'Time format in strftime standard.',
},
form: 'form',
llm_description: null,
variable: 'format',
@ -39,226 +33,18 @@ const mockSchema = [
tooltip: {
en_US: 'Time format in strftime standard.',
zh_Hans: 'strftime 标准的时间格式。',
pt_BR: 'Time format in strftime standard.',
ja_JP: 'Time format in strftime standard.',
},
},
{
name: 'timezone',
name: 'model',
type: FormTypeEnum.modelSelector,
label: {
en_US: 'Timezone',
zh_Hans: '时区',
pt_BR: 'Timezone',
ja_JP: 'Timezone',
},
placeholder: null,
scope: null,
required: false,
default: 'UTC',
min: null,
max: null,
options: [
{
value: 'UTC',
label: {
en_US: 'UTC',
zh_Hans: 'UTC',
pt_BR: 'UTC',
ja_JP: 'UTC',
},
show_on: [],
},
{
value: 'America/New_York',
label: {
en_US: 'America/New_York',
zh_Hans: '美洲/纽约',
pt_BR: 'America/New_York',
ja_JP: 'America/New_York',
},
show_on: [],
},
{
value: 'America/Los_Angeles',
label: {
en_US: 'America/Los_Angeles',
zh_Hans: '美洲/洛杉矶',
pt_BR: 'America/Los_Angeles',
ja_JP: 'America/Los_Angeles',
},
show_on: [],
},
{
value: 'America/Chicago',
label: {
en_US: 'America/Chicago',
zh_Hans: '美洲/芝加哥',
pt_BR: 'America/Chicago',
ja_JP: 'America/Chicago',
},
show_on: [],
},
{
value: 'America/Sao_Paulo',
label: {
en_US: 'America/Sao_Paulo',
zh_Hans: '美洲/圣保罗',
pt_BR: 'América/São Paulo',
ja_JP: 'America/Sao_Paulo',
},
show_on: [],
},
{
value: 'Asia/Shanghai',
label: {
en_US: 'Asia/Shanghai',
zh_Hans: '亚洲/上海',
pt_BR: 'Asia/Shanghai',
ja_JP: 'Asia/Shanghai',
},
show_on: [],
},
{
value: 'Asia/Ho_Chi_Minh',
label: {
en_US: 'Asia/Ho_Chi_Minh',
zh_Hans: '亚洲/胡志明市',
pt_BR: 'Ásia/Ho Chi Minh',
ja_JP: 'Asia/Ho_Chi_Minh',
},
show_on: [],
},
{
value: 'Asia/Tokyo',
label: {
en_US: 'Asia/Tokyo',
zh_Hans: '亚洲/东京',
pt_BR: 'Asia/Tokyo',
ja_JP: 'Asia/Tokyo',
},
show_on: [],
},
{
value: 'Asia/Dubai',
label: {
en_US: 'Asia/Dubai',
zh_Hans: '亚洲/迪拜',
pt_BR: 'Asia/Dubai',
ja_JP: 'Asia/Dubai',
},
show_on: [],
},
{
value: 'Asia/Kolkata',
label: {
en_US: 'Asia/Kolkata',
zh_Hans: '亚洲/加尔各答',
pt_BR: 'Asia/Kolkata',
ja_JP: 'Asia/Kolkata',
},
show_on: [],
},
{
value: 'Asia/Seoul',
label: {
en_US: 'Asia/Seoul',
zh_Hans: '亚洲/首尔',
pt_BR: 'Asia/Seoul',
ja_JP: 'Asia/Seoul',
},
show_on: [],
},
{
value: 'Asia/Singapore',
label: {
en_US: 'Asia/Singapore',
zh_Hans: '亚洲/新加坡',
pt_BR: 'Asia/Singapore',
ja_JP: 'Asia/Singapore',
},
show_on: [],
},
{
value: 'Europe/London',
label: {
en_US: 'Europe/London',
zh_Hans: '欧洲/伦敦',
pt_BR: 'Europe/London',
ja_JP: 'Europe/London',
},
show_on: [],
},
{
value: 'Europe/Berlin',
label: {
en_US: 'Europe/Berlin',
zh_Hans: '欧洲/柏林',
pt_BR: 'Europe/Berlin',
ja_JP: 'Europe/Berlin',
},
show_on: [],
},
{
value: 'Europe/Moscow',
label: {
en_US: 'Europe/Moscow',
zh_Hans: '欧洲/莫斯科',
pt_BR: 'Europe/Moscow',
ja_JP: 'Europe/Moscow',
},
show_on: [],
},
{
value: 'Australia/Sydney',
label: {
en_US: 'Australia/Sydney',
zh_Hans: '澳大利亚/悉尼',
pt_BR: 'Australia/Sydney',
ja_JP: 'Australia/Sydney',
},
show_on: [],
},
{
value: 'Pacific/Auckland',
label: {
en_US: 'Pacific/Auckland',
zh_Hans: '太平洋/奥克兰',
pt_BR: 'Pacific/Auckland',
ja_JP: 'Pacific/Auckland',
},
show_on: [],
},
{
value: 'Africa/Cairo',
label: {
en_US: 'Africa/Cairo',
zh_Hans: '非洲/开罗',
pt_BR: 'Africa/Cairo',
ja_JP: 'Africa/Cairo',
},
show_on: [],
},
],
type: 'select',
human_description: {
en_US: 'Timezone',
zh_Hans: '时区',
pt_BR: 'Timezone',
ja_JP: 'Timezone',
},
form: 'form',
llm_description: null,
variable: 'timezone',
_type: 'select',
show_on: [],
tooltip: {
en_US: 'Timezone',
zh_Hans: '时区',
pt_BR: 'Timezone',
ja_JP: 'Timezone',
en_US: 'Model',
zh_Hans: '模型',
},
scope: 'all',
},
] as const
] as Array<CredentialFormSchema & { name: string }>
const AgentPanel: FC<NodePanelProps<AgentNodeType>> = (props) => {
const { inputs, setInputs } = useConfig(props.id, props.data)