2024-06-07 13:46:50 +08:00
|
|
|
import {
|
|
|
|
|
MergeCellsOutlined,
|
|
|
|
|
RocketOutlined,
|
|
|
|
|
SendOutlined,
|
|
|
|
|
} from '@ant-design/icons';
|
|
|
|
|
|
2024-06-05 10:46:06 +08:00
|
|
|
export enum Operator {
|
|
|
|
|
Begin = 'Begin',
|
|
|
|
|
Retrieval = 'Retrieval',
|
|
|
|
|
Generate = 'Generate',
|
|
|
|
|
Answer = 'Answer',
|
|
|
|
|
}
|
2024-06-06 11:01:14 +08:00
|
|
|
|
2024-06-07 13:46:50 +08:00
|
|
|
export const componentList = [
|
|
|
|
|
{ name: Operator.Retrieval, icon: <RocketOutlined />, description: '' },
|
|
|
|
|
{ name: Operator.Generate, icon: <MergeCellsOutlined />, description: '' },
|
|
|
|
|
{ name: Operator.Answer, icon: <SendOutlined />, description: '' },
|
|
|
|
|
];
|
|
|
|
|
|
2024-06-06 11:01:14 +08:00
|
|
|
export const initialRetrievalValues = {
|
|
|
|
|
similarity_threshold: 0.2,
|
|
|
|
|
keywords_similarity_weight: 0.3,
|
|
|
|
|
top_n: 8,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const initialBeginValues = {
|
|
|
|
|
prologue: `Hi! I'm your assistant, what can I do for you?`,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const initialGenerateValues = {
|
2024-06-06 15:00:37 +08:00
|
|
|
// parameters: ModelVariableType.Precise,
|
|
|
|
|
// temperatureEnabled: true,
|
2024-06-06 11:01:14 +08:00
|
|
|
temperature: 0.1,
|
|
|
|
|
top_p: 0.3,
|
|
|
|
|
frequency_penalty: 0.7,
|
|
|
|
|
presence_penalty: 0.4,
|
|
|
|
|
max_tokens: 512,
|
|
|
|
|
prompt: `Please summarize the following paragraphs. Be careful with the numbers, do not make things up. Paragraphs as following:
|
|
|
|
|
{cluster_content}
|
|
|
|
|
The above is the content you need to summarize.`,
|
|
|
|
|
cite: true,
|
|
|
|
|
};
|
2024-06-06 15:00:37 +08:00
|
|
|
|
|
|
|
|
export const initialFormValuesMap = {
|
|
|
|
|
[Operator.Begin]: initialBeginValues,
|
|
|
|
|
[Operator.Retrieval]: initialRetrievalValues,
|
|
|
|
|
[Operator.Generate]: initialGenerateValues,
|
|
|
|
|
[Operator.Answer]: {},
|
|
|
|
|
};
|