cleanup
This commit is contained in:
parent
c610bb605a
commit
c75a6390bf
3 changed files with 4 additions and 8 deletions
|
|
@ -26,9 +26,7 @@ export const MetadataFilterSchema = {
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.optional(),
|
.optional(),
|
||||||
semi_auto: z
|
semi_auto: z.array(z.string()).optional(),
|
||||||
.array(z.string()) // 修改为字符串数组
|
|
||||||
.optional(),
|
|
||||||
})
|
})
|
||||||
.optional(),
|
.optional(),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ export function MetadataSemiAutoFields({
|
||||||
|
|
||||||
const add = useCallback(
|
const add = useCallback(
|
||||||
(key: string) => () => {
|
(key: string) => () => {
|
||||||
append(key); // 直接添加字符串而不是对象
|
append(key);
|
||||||
},
|
},
|
||||||
[append],
|
[append],
|
||||||
);
|
);
|
||||||
|
|
@ -66,7 +66,6 @@ export function MetadataSemiAutoFields({
|
||||||
</div>
|
</div>
|
||||||
<div className="space-y-5">
|
<div className="space-y-5">
|
||||||
{fields.map((field, index) => {
|
{fields.map((field, index) => {
|
||||||
// 修改字段名称以直接引用数组元素
|
|
||||||
const typeField = `${name}.${index}`;
|
const typeField = `${name}.${index}`;
|
||||||
return (
|
return (
|
||||||
<section key={field.id} className="flex gap-2">
|
<section key={field.id} className="flex gap-2">
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,8 @@ export default function TestingForm({
|
||||||
setValues,
|
setValues,
|
||||||
}: TestingFormProps) {
|
}: TestingFormProps) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { id } = useParams(); // 正确解构出id参数
|
const { id } = useParams();
|
||||||
const knowledgeBaseId = id; // 现在knowledgeBaseId是字符串类型
|
const knowledgeBaseId = id;
|
||||||
|
|
||||||
const formSchema = z.object({
|
const formSchema = z.object({
|
||||||
question: z.string().min(1, {
|
question: z.string().min(1, {
|
||||||
|
|
@ -100,7 +100,6 @@ export default function TestingForm({
|
||||||
<CrossLanguageFormField
|
<CrossLanguageFormField
|
||||||
name={'cross_languages'}
|
name={'cross_languages'}
|
||||||
></CrossLanguageFormField>
|
></CrossLanguageFormField>
|
||||||
{/* 添加元数据过滤组件 */}
|
|
||||||
<MetadataFilter prefix=""></MetadataFilter>
|
<MetadataFilter prefix=""></MetadataFilter>
|
||||||
</FormContainer>
|
</FormContainer>
|
||||||
<FormField
|
<FormField
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue