Feat: Add VariablePickerMenuPlugin to select variables in the prompt text box by menu #4764 (#4765)

### What problem does this PR solve?

Feat: Add VariablePickerMenuPlugin to select variables in the prompt
text box by menu #4764

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-02-08 18:09:13 +08:00
committed by GitHub
parent f64ae9dc33
commit bfcc2abe47
19 changed files with 1058 additions and 126 deletions

View File

@ -6,6 +6,12 @@ const list = new Array(15).fill({
content: `Lorem ipsum odor amet, consectetuer adipiscing elit. Ullamcorper vulputate id laoreet malesuada commodo molestie. Lectus convallis class euismod; consequat in curabitur. Ablandit praesent inceptos nibh placerat lectus fringilla finibus. Hac vivamus id scelerisque et gravida nec ligula et non. Consectetur eu himenaeos eget felis quis habitant tellus. Tellus commodo inceptos litora habitant per himenaeos faucibus pretium. Gravida velit pretium amet purus rhoncus taciti. `,
});
const SimilarityList = [
{ label: '混合相似度', value: 45.88 },
{ label: '关键词似度', value: 45.88 },
{ label: '向量相似度', value: 45.88 },
];
export default function RetrievalTesting() {
return (
<section className="flex divide-x h-full">
@ -13,7 +19,7 @@ export default function RetrievalTesting() {
<TestingForm></TestingForm>
</div>
<div className="p-4 flex-1 ">
<h2 className="text-3xl font-bold mb-8 px-[10%]">
<h2 className="text-4xl font-bold mb-8 px-[10%]">
15 Results from 3 files
</h2>
<section className="flex flex-col gap-4 overflow-auto h-[83vh] px-[10%]">
@ -25,24 +31,18 @@ export default function RetrievalTesting() {
<CardHeader>
<CardTitle>
<div className="flex gap-2 flex-wrap">
<Badge
variant="outline"
className="bg-colors-background-inverse-strong p-2 rounded-xl text-base"
>
45.88
</Badge>
<Badge
variant="outline"
className="bg-colors-background-inverse-strong p-2 rounded-xl text-base"
>
45.88
</Badge>
<Badge
variant="outline"
className="bg-colors-background-inverse-strong p-2 rounded-xl text-base"
>
45.88
</Badge>
{SimilarityList.map((x, idx) => (
<Badge
key={idx}
variant="outline"
className="bg-colors-background-inverse-strong p-1.5 rounded-xl text-colors-text-inverse-weak text-base"
>
{x.label}
<span className="text-colors-text-inverse-strong ml-1 text-lg leading-none">
{x.value}
</span>
</Badge>
))}
</div>
</CardTitle>
</CardHeader>