File size: 1,920 Bytes
8da11cb
 
 
 
454aa85
8da11cb
 
be99f83
 
 
 
 
 
13080d4
454aa85
 
 
 
 
 
 
ddd1aa2
 
 
 
 
 
 
 
 
 
454aa85
 
ddd1aa2
454aa85
 
 
ddd1aa2
454aa85
 
 
ddd1aa2
454aa85
8da11cb
 
13080d4
 
 
 
 
 
 
 
 
 
 
c939fd2
 
13080d4
 
 
 
 
 
 
 
 
 
c939fd2
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import {
  MergeCellsOutlined,
  RocketOutlined,
  SendOutlined,
  SlidersOutlined,
} from '@ant-design/icons';

export enum Operator {
  Begin = 'Begin',
  Retrieval = 'Retrieval',
  Generate = 'Generate',
  Answer = 'Answer',
}

export const operatorIconMap = {
  [Operator.Retrieval]: RocketOutlined,
  [Operator.Generate]: MergeCellsOutlined,
  [Operator.Answer]: SendOutlined,
  [Operator.Begin]: SlidersOutlined,
};

export const operatorMap = {
  [Operator.Retrieval]: {
    description: 'Retrieval description drjlftglrthjftl',
  },
  [Operator.Generate]: { description: 'Generate description' },
  [Operator.Answer]: { description: 'Answer description' },
  [Operator.Begin]: { description: 'Begin description' },
};

export const componentMenuList = [
  {
    name: Operator.Retrieval,
    description: operatorMap[Operator.Retrieval].description,
  },
  {
    name: Operator.Generate,
    description: operatorMap[Operator.Generate].description,
  },
  {
    name: Operator.Answer,
    description: operatorMap[Operator.Answer].description,
  },
];

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 = {
  // parameters: ModelVariableType.Precise,
  // temperatureEnabled: true,
  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,
};

export const initialFormValuesMap = {
  [Operator.Begin]: initialBeginValues,
  [Operator.Retrieval]: initialRetrievalValues,
  [Operator.Generate]: initialGenerateValues,
  [Operator.Answer]: {},
};