mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-12 19:29:01 +08:00
feat: add LLMSelect (#1270)
### What problem does this PR solve? feat: add LLMSelect #918 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
parent
b75bb1d8d3
commit
d1ea429bdd
23
web/src/components/llm-select/index.tsx
Normal file
23
web/src/components/llm-select/index.tsx
Normal file
@ -0,0 +1,23 @@
|
||||
import { Popover, Select } from 'antd';
|
||||
import LlmSettingItems from '../llm-setting-items';
|
||||
|
||||
const LLMSelect = () => {
|
||||
const content = (
|
||||
<div>
|
||||
<LlmSettingItems handleParametersChange={() => {}}></LlmSettingItems>
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<Popover content={content} trigger="click" placement="left" arrow={false}>
|
||||
{/* <Button>Click me</Button> */}
|
||||
<Select
|
||||
defaultValue="lucy"
|
||||
style={{ width: '100%' }}
|
||||
dropdownStyle={{ display: 'none' }}
|
||||
/>
|
||||
</Popover>
|
||||
);
|
||||
};
|
||||
|
||||
export default LLMSelect;
|
11
web/src/pages/flow/categorize-form/index.tsx
Normal file
11
web/src/pages/flow/categorize-form/index.tsx
Normal file
@ -0,0 +1,11 @@
|
||||
import LLMSelect from '@/components/llm-select';
|
||||
|
||||
const CategorizeForm = () => {
|
||||
return (
|
||||
<section>
|
||||
<LLMSelect></LLMSelect>
|
||||
</section>
|
||||
);
|
||||
};
|
||||
|
||||
export default CategorizeForm;
|
@ -1,4 +1,5 @@
|
||||
import {
|
||||
DatabaseOutlined,
|
||||
MergeCellsOutlined,
|
||||
RocketOutlined,
|
||||
SendOutlined,
|
||||
@ -10,6 +11,7 @@ export enum Operator {
|
||||
Retrieval = 'Retrieval',
|
||||
Generate = 'Generate',
|
||||
Answer = 'Answer',
|
||||
Categorize = 'Categorize',
|
||||
}
|
||||
|
||||
export const operatorIconMap = {
|
||||
@ -17,6 +19,7 @@ export const operatorIconMap = {
|
||||
[Operator.Generate]: MergeCellsOutlined,
|
||||
[Operator.Answer]: SendOutlined,
|
||||
[Operator.Begin]: SlidersOutlined,
|
||||
[Operator.Categorize]: DatabaseOutlined,
|
||||
};
|
||||
|
||||
export const operatorMap = {
|
||||
@ -26,6 +29,7 @@ export const operatorMap = {
|
||||
[Operator.Generate]: { description: 'Generate description' },
|
||||
[Operator.Answer]: { description: 'Answer description' },
|
||||
[Operator.Begin]: { description: 'Begin description' },
|
||||
[Operator.Categorize]: { description: 'Categorize description' },
|
||||
};
|
||||
|
||||
export const componentMenuList = [
|
||||
@ -41,6 +45,10 @@ export const componentMenuList = [
|
||||
name: Operator.Answer,
|
||||
description: operatorMap[Operator.Answer].description,
|
||||
},
|
||||
{
|
||||
name: Operator.Categorize,
|
||||
description: operatorMap[Operator.Categorize].description,
|
||||
},
|
||||
];
|
||||
|
||||
export const initialRetrievalValues = {
|
||||
|
@ -4,6 +4,7 @@ import { useEffect } from 'react';
|
||||
import { Node } from 'reactflow';
|
||||
import AnswerForm from '../answer-form';
|
||||
import BeginForm from '../begin-form';
|
||||
import CategorizeForm from '../categorize-form';
|
||||
import { Operator } from '../constant';
|
||||
import GenerateForm from '../generate-form';
|
||||
import { useHandleFormValuesChange } from '../hooks';
|
||||
@ -18,6 +19,7 @@ const FormMap = {
|
||||
[Operator.Retrieval]: RetrievalForm,
|
||||
[Operator.Generate]: GenerateForm,
|
||||
[Operator.Answer]: AnswerForm,
|
||||
[Operator.Categorize]: CategorizeForm,
|
||||
};
|
||||
|
||||
const FlowDrawer = ({
|
||||
|
Loading…
x
Reference in New Issue
Block a user