Spaces:
Running
Running
Create prompts.py
Browse files- prompts.py +58 -0
prompts.py
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
class ChiplingPrompts:
|
2 |
+
|
3 |
+
def generateModules(searchQuery):
|
4 |
+
prompt = '''
|
5 |
+
Generate a structured learning path for the topic: "${searchQuery}".
|
6 |
+
|
7 |
+
Please provide all the modules (chapters) associated with the topic to cover all the content for the respective topic, with each module having:
|
8 |
+
- A title
|
9 |
+
- all the topics that are specifically related to that module
|
10 |
+
- generate more than 4 topics for each module
|
11 |
+
|
12 |
+
For each topic, include:
|
13 |
+
- A title
|
14 |
+
- A relevance score (1-10)
|
15 |
+
- A short description (2-3 sentences)
|
16 |
+
|
17 |
+
Format the response as JSON that matches this TypeScript interface:
|
18 |
+
{
|
19 |
+
modules: Array<{
|
20 |
+
title: string;
|
21 |
+
topics: Array<{
|
22 |
+
title: string;
|
23 |
+
relevance: number;
|
24 |
+
description: string;
|
25 |
+
}>
|
26 |
+
}>
|
27 |
+
}
|
28 |
+
|
29 |
+
Each module should build on the previous one, progressively increasing in complexity or depth.
|
30 |
+
Only respond with the JSON data.`
|
31 |
+
'''
|
32 |
+
return prompt
|
33 |
+
|
34 |
+
def generateTopics(searchQuery):
|
35 |
+
prompt = '''
|
36 |
+
Generate detailed information about the topic: "${searchQuery}".
|
37 |
+
Please include:
|
38 |
+
- A comprehensive content section (3-4 paragraphs)
|
39 |
+
- 2-3 subtopics, each with title, description, and content
|
40 |
+
- 3-5 references or further reading suggestions
|
41 |
+
|
42 |
+
Format the response as JSON that matches this TypeScript interface:
|
43 |
+
{
|
44 |
+
title: string;
|
45 |
+
relevance: number;
|
46 |
+
description: string;
|
47 |
+
content: string;
|
48 |
+
subtopics: Array<{
|
49 |
+
title: string;
|
50 |
+
description: string;
|
51 |
+
content: string;
|
52 |
+
}>;
|
53 |
+
references: string[];
|
54 |
+
}
|
55 |
+
|
56 |
+
Only respond with the JSON data.
|
57 |
+
'''
|
58 |
+
return prompt
|