1hangzhao commited on
Commit
9ea2329
·
verified ·
1 Parent(s): 82b893a

Update ontochat/functions.py

Browse files
Files changed (1) hide show
  1. ontochat/functions.py +101 -9
ontochat/functions.py CHANGED
@@ -8,17 +8,108 @@ openai_api_key = None
8
 
9
  current_preidentified_prompts = []
10
  current_preidentified = [
11
- "The domain of this ontology is **[DOMAIN]**. Please take note of this specified domain, as all subsequent responses and information provided should be strictly aligned with and accurately reflect the scope and context of this domain.",
12
- "My name is **[NAME]**, I am **[AGE]** years old, and I work as a **[OCCUPATION]**. My skills include **[SKILLS]**, and I have a strong interest in **[INTERESTS]**. Can you help me refine my answers to ensure: 1. Each detail is clearly described, specific, and easy to understand, avoiding vague or overly broad statements. 2. The details (name, age, occupation, skills, interests) are logically and professionally aligned to showcase a cohesive and relevant persona. 3. The refined skills and interests highlight areas of expertise and enthusiasm directly connected to my occupation and goals. 4. The language is polished, concise, and written in a professional tone suitable for formal contexts. 5. The refined output is structured in a clear, well-organized bullet-point format for easy readability and usability.",
13
- "My user goal description is **[USER GOAL DESCRIPTION]**. Can you help me refine my answer to ensure: 1. The goal is clearly articulated, specific, and easy to understand, avoiding ambiguity or overly broad statements. 2. The description is aligned with my interests, domain expertise, and intended purpose, showcasing its relevance to my context. 3. The focus remains solely on the goal, without referencing or including actions, keywords, or unrelated details. 4. The refined description highlights the significance of the goal and its practical value within my domain. 5. The language is polished, concise, and professionally written, suitable for formal contexts. 6. The original intent and relevance of the goal are preserved without altering its meaning or purpose. 7. The final refined answer is presented in a single, clear, and well-crafted sentence.",
14
- "The actions I need to take to achieve my goal are **[ACTIONS]**. Can you help me refine my answer to ensure: 1. The actions are clearly described and actionable, detailing specific steps or processes. 2. They align logically with my skills, expertise, and overall goal, showcasing their relevance and practicality. 3. Each action is specific enough to illustrate its purpose but adaptable enough to apply to varying scenarios. 4. The description avoids redundancy and focuses solely on the actions without referencing unrelated elements. 5. The language is concise, precise, and written in a professional tone. 6. The final refined answer is presented as a single, polished, and well-crafted sentence.",
15
- "The keywords for my user goal and actions are **[KEYWORDS]**. Can you help me refine these keywords to ensure: 1. They are clearly articulated, specific, and easy to understand, avoiding vague or overly broad terms. 2. Each keyword is highly relevant and directly connected to my goal and actions, reflecting their significance. 3. The list is free of unnecessary or redundant keywords, focusing on terms with high practical value. 4. The language is concise, precise, and aligned with the professional context of my domain. 5. The refined list includes at most 5 keywords, presented in a clear, structured, and organized manner.",
16
- "The current methods I use to perform my actions are **[CURRENT METHODS]**. Can you help me refine these methods to ensure: 1. They are clearly described and actionable, reflecting accurate steps or processes. 2. They align with my occupation, skills, and overall goal. 3. The language is concise, precise, and free from unnecessary details. 4. The focus is solely on the current methods, without including challenges, new methods, or outcomes. 5. The final refined answer is presented as a single, well-crafted sentence.",
17
- "The challenges I face with my current methods are **[CHALLENGES]**. Can you help me refine these challenges to ensure: 1. They are realistic and grounded in the context of my current methods. 2. Each challenge is clearly articulated and highlights specific obstacles or difficulties I encounter. 3. They logically relate to my skills, occupation, and overall goal, providing insight into areas that need improvement. 4. The challenges are actionable, meaning they identify issues that can be realistically addressed or mitigated. 5. The language is concise and professional, focusing only on the challenges without referencing or altering the current methods, new methods, or outcomes. 6. The final refined answer is presented as a single, well-crafted sentence.",
18
- "The new methods I will use through this ontology to address my challenges are **[NEW METHODS]**. Can you help me refine these new methods to ensure: 1. They are clearly described and actionable, demonstrating how they address the specified challenges. 2. They logically align with my occupation, skills, and overall goal, showcasing their relevance and practicality. 3. The refined methods focus solely on new approaches, without referencing or altering the current methods, challenges, or outcomes. 4. Each method is specific enough to illustrate its purpose but general enough to allow flexibility in implementation. 5. The language is concise, precise, and professionally written. 6. The final refined answer is presented as a single, well-crafted sentence.",
19
- "The outcomes I expect after implementing the new methods are **[OUTCOMES]**. Can you help me refine these outcomes to ensure: 1. They are clearly described and measurable, showing the direct results of addressing the specified challenges. 2. They align logically with my occupation, skills, and overall goal, demonstrating tangible benefits or improvements. 3. The refined outcomes focus solely on the results, without altering or referencing the current methods, challenges, or new methods. 4. Each outcome is specific enough to highlight its value but general enough to apply across relevant scenarios. 5. The language is concise, precise, and professionally articulated. 6. The final refined answer is presented as a single, well-crafted sentence."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  ]
21
 
 
 
 
 
22
  def load_example(selection):
23
  return current_preidentified[selection]
24
 
@@ -48,6 +139,7 @@ def user_story_generator(message, history):
48
 
49
  "You are an ontology engineer conducting an interview with a domain expert to gather information for writing an ontology user story."
50
  "Ask elicitation questions one at a time, providing an example answer and the prompt template the user should use, while incorporating user feedback if needed."
 
51
  "If all requirements for the current elicitation are fully addressed, always ask the user if this meets their expectations. Do not ask the next question unless the user confirms the current one is satisfactory."
52
  "When a domain expert requests refinement, provide just one focused point in one sentence, directly aligned with their current answer."
53
  "The user can request to revisit any previously completed steps."
 
8
 
9
  current_preidentified_prompts = []
10
  current_preidentified = [
11
+ """The ontology's domain is **[DOMAIN]**.
12
+
13
+ Ensure all subsequent responses strictly adhere to the scope of my domain.""",
14
+
15
+ """My name is **[NAME]**, I am **[AGE]** years old, and I work as a **[OCCUPATION]**. My skills include **[SKILLS]**, and I have a strong interest in **[INTERESTS]**.
16
+
17
+ Please refine my response to ensure:
18
+
19
+ 1. The persona is clearly described.
20
+ 2. The details (name, age, occupation, skills, interests) are logically and professionally aligned.
21
+ 3. If the skills and interests provided by the user are very similar and hard to differentiate, try to generate distinct ones. Skills should focus on technical aspects, while interests should be more general.
22
+ 4. The language is concise, precise, and written in a professional tone.
23
+ 5. The final refined answer is structured as bullet points.""",
24
+
25
+
26
+ """My user goal description is **[USER GOAL DESCRIPTION]**.
27
+
28
+ Please refine my response to ensure:
29
+
30
+ 1. The goal is clearly described and practical.
31
+ 2. Expand the user goal description, if necessary, to ensure it starts with a high-level overview *[LONG-TERM GOAL]*, emphasizing the overall impact, followed by a specific *[SHORT-TERM GOAL]*, focusing on immediate outcomes.
32
+ 3. Ensure the goal description aligns with my interests, domain expertise.
33
+ 4. The focus remains solely on the goal, without referencing unrelated elements.
34
+ 5. The language is concise, precise, and written in a professional tone.
35
+ 6. The final refined answer is presented as bullet points, with the first bullet for the long-term goal and the second bullet for the short-term goal.""",
36
+
37
+ """The actions I need to take to achieve my goal are **[ACTIONS]**.
38
+
39
+ Please refine my response to ensure:
40
+
41
+ 1. The actions are clearly described.
42
+ 2. The actions are actionable and presented as a logical sequence of steps.
43
+ 3. Each step includes specific *[TOOLS]*, *[METHODS]*, or *[TECHNIQUES]*, and is practical.
44
+ 4. Where relevant, incorporate *[INTERDISCIPLINARY INSIGHTS]* to describe the actions.
45
+ 5. Ensure the actions align logically with my skills, occupation, and overall goal.
46
+ 6. The language is concise, precise, and written in a professional tone.
47
+ 7. The final refined answer is structured as bullet points, with each step represented as a separate bullet.""",
48
+
49
+ """The keywords for my user goal and actions are **[KEYWORDS]**.
50
+
51
+ Please refine my response to ensure:
52
+
53
+ 1. The Keywords are clearly defined.
54
+ 2. Each keyword directly supports my goals and actions.
55
+ 3. Keywords are expanded with the same level of granularity as *[KEYWORD]*.
56
+ 4. Keywords are broadened to include additional options.
57
+ 5. The language is concise, precise, and professional.
58
+ 6. The final refined answer is structured as bullet points.""",
59
+
60
+ """The current methods I use to perform my actions are **[CURRENT METHODS]**.
61
+
62
+ Please refine my response to ensure:
63
+
64
+ 1. The methods are clearly described.
65
+ 2. The methods must be manually time-intensive.
66
+ 3. The methods are actionable and presented as a logical sequence of steps.
67
+ 4. Each step includes specific *[TOOLS]*, *[METHODS]*, or *[TECHNIQUES]*, and is practical.
68
+ 5. Where relevant, incorporate *[INTERDISCIPLINARY INSIGHTS]* to describe the methods.
69
+ 6. The methods align logically with my skills, occupation, and overall goal.
70
+ 7. The methods include only the methods themselves, without any words describing challenges, new methods and outcomes.
71
+ 8. The language is concise, precise, and written in a professional tone.
72
+ 9. The final refined answer is structured as bullet points, with each step represented as a separate bullet.""",
73
+
74
+ """The challenges I face with my current methods are **[CHALLENGES]**.
75
+
76
+ Please refine my response to ensure:
77
+
78
+ 1. The challenges are clearly described.
79
+ 2. Each challenge should be derived from the *[TOOLS]*, *[METHODS]*, or *[TECHNIQUES]* used.
80
+ 3. Where relevant, incorporate *[INTERDISCIPLINARY INSIGHTS]* to describe the challenges.
81
+ 4. The challenges align logically with my skills, occupation, and overall goal.
82
+ 5. The challenges include only the challenges themselves, without any words describing current methods, new methods and outcomes.
83
+ 6. The language is concise, precise, and written in a professional tone.
84
+ 7. The final refined answer is structured as bullet points, with each challenge represented as a separate bullet.""",
85
+
86
+ """The new methods I will use through this ontology to address my challenges are **[NEW METHODS]**.
87
+
88
+ Please refine my response to ensure:
89
+
90
+ 1. The new methods are clearly described.
91
+ 2. The new methods must align with what a knowledge-based system can offer.
92
+ 3. The new methods align logically with my overall goal.
93
+ 4. The new methods include only the new methods themselves, without any words describing current methods, challenges and outcomes.
94
+ 5. The language is concise, precise, and written in a professional tone.
95
+ 6. The final refined answer is presented as a single, well-crafted sentence.""",
96
+
97
+ """The outcomes I expect after implementing the new methods are **[OUTCOMES]**..
98
+
99
+ Please refine my response to ensure:
100
+
101
+ 1. The outcomes are clearly described.
102
+ 2. The outcomes must align with the benefits a knowledge-based system can provide.
103
+ 3. The outcomes align logically with my overall goal.
104
+ 4. The outcomes include only the outcomes themselves, without any words describing current methods, challenges and new methods.
105
+ 5. The language is concise, precise, and written in a professional tone.
106
+ 6. The final refined answer is structured as bullet points, with each outcome represented as a separate bullet.""",
107
  ]
108
 
109
+
110
+
111
+
112
+
113
  def load_example(selection):
114
  return current_preidentified[selection]
115
 
 
139
 
140
  "You are an ontology engineer conducting an interview with a domain expert to gather information for writing an ontology user story."
141
  "Ask elicitation questions one at a time, providing an example answer and the prompt template the user should use, while incorporating user feedback if needed."
142
+
143
  "If all requirements for the current elicitation are fully addressed, always ask the user if this meets their expectations. Do not ask the next question unless the user confirms the current one is satisfactory."
144
  "When a domain expert requests refinement, provide just one focused point in one sentence, directly aligned with their current answer."
145
  "The user can request to revisit any previously completed steps."