-
Notifications
You must be signed in to change notification settings - Fork 20
/
prompts.ts
82 lines (82 loc) · 2.03 KB
/
prompts.ts
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
77
78
79
80
81
82
export const prompts = [
{
name: 'Fix grammar',
params: ['Language'],
generatePrompt: (source: string, language: string) => ({
model: 'text-davinci-003',
prompt: `Correct this to standard ${language}:\n\n${source}`,
temperature: 0,
max_tokens: 60,
top_p: 1.0,
frequency_penalty: 0.0,
presence_penalty: 0.0,
}),
},
{
name: 'Translate to',
params: ['Language'],
generatePrompt: (source: string, language: string) => ({
model: 'text-davinci-003',
prompt: `Translate this to ${language}:\n\n${source}`,
temperature: 0,
max_tokens: 60,
top_p: 1.0,
frequency_penalty: 0.0,
presence_penalty: 0.0,
stop: '\n',
stream: true,
logprobs: 10,
echo: true,
language: 'de',
}),
},
{
name: 'Extract Keywords',
generatePrompt: (source: string) => ({
model: 'text-davinci-003',
prompt: `Extract keywords from this text:\n\n${source}`,
temperature: 0.5,
max_tokens: 60,
top_p: 1.0,
frequency_penalty: 0.8,
presence_penalty: 0.0,
}),
},
{
name: 'Summarize',
generatePrompt: (source: string) => ({
model: 'text-davinci-003',
prompt: `Summarize this text:\n\n${source}`,
temperature: 0.5,
max_tokens: 60,
top_p: 1.0,
frequency_penalty: 0.8,
presence_penalty: 0.0,
}),
},
{
name: 'Explain it like I am 5',
generatePrompt: (source: string) => ({
model: 'text-davinci-003',
prompt: `Explain this to a 5 year old:\n\n${source}`,
temperature: 0.5,
max_tokens: 60,
top_p: 1.0,
frequency_penalty: 0.8,
presence_penalty: 0.0,
}),
},
{
name: 'Change tone',
params: ['Tone'],
generatePrompt: (source: string, tone: string) => ({
model: 'text-davinci-003',
prompt: `Change the tone of this text to ${tone}:\n\n${source}`,
temperature: 0.5,
max_tokens: 60,
top_p: 1.0,
frequency_penalty: 0.8,
presence_penalty: 0.0,
}),
},
];