Fiacre commited on
Commit
619a306
1 Parent(s): 115c32c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -12
app.py CHANGED
@@ -19,7 +19,7 @@ def limit_input_length(user_input, max_length=1000):
19
  user_input = user_input[:max_length]
20
  return user_input
21
 
22
- def get_response_from_llm(describe_your_project_idea_here):
23
  describe_your_project_idea_here = sanitize_input(describe_your_project_idea_here)
24
  describe_your_project_idea_here = limit_input_length(describe_your_project_idea_here, max_length=1000)
25
  messages = [{"role": "user", "content": prompt_injection_check_pre + describe_your_project_idea_here + prompt_injection_check_post + task + describe_your_project_idea_here + formatting}]
@@ -33,21 +33,12 @@ def get_response_from_llm(describe_your_project_idea_here):
33
  def get_project_scope(describe_your_project_idea_here):
34
  task =f""" Your task is to help a university lecturer create a project scope table for """
35
  formatting = f"""Define what is the project objective, in scope, out of scope and assumptions. Do this in a tabular format. The table comprises six rows. The first row is a single column labeled "Project Objective". The second row is a single column stating the project objectives. The thid row contains two columns labeled "In Scope" and "Out of Scope". The fourth row contains two columns describing what is in scope and out of scope. The fifth row is a single column named "Assumptions". The sixth row is a single column describing the assumptions. Below each of these name, populate with detail content relevant to each title."""
36
- return get_response_from_llm(describe_your_project_idea_here)
37
 
38
  def get_change_impact_assessment(describe_your_project_idea_here):
39
  task =f""" Your task is to help a university lecturer create a change impact assessment for """
40
  formatting = f"""For each of these job aspects: Processes Systems Tools Job roles Critical behaviours Mindset/Attitudes/behaviour Reporting structure Performance reviews Compensation Location, Comment on these in a tabular format: Will this job aspect be impacted by the change? What are the specific details of the impact? What roles will be impacted by the change? Support options recommended: • Consultation • Training/ Instruction • Information/messaging • Coaching/mentoring • Other"""
41
- describe_your_project_idea_here = sanitize_input(describe_your_project_idea_here)
42
- describe_your_project_idea_here = limit_input_length(describe_your_project_idea_here, max_length=1000)
43
- messages = [{"role": "user", "content": prompt_injection_check_pre + describe_your_project_idea_here + prompt_injection_check_post + task + describe_your_project_idea_here + formatting}]
44
- response = openai.ChatCompletion.create(
45
- model=model,
46
- messages=messages,
47
- temperature=0,
48
- )
49
- project_scope = response.choices[0].message["content"]
50
- return project_scope
51
 
52
  def get_scope_and_change_impact_assessment(describe_your_project_idea_here):
53
  scope = get_project_scope(describe_your_project_idea_here)
 
19
  user_input = user_input[:max_length]
20
  return user_input
21
 
22
+ def get_response_from_llm(describe_your_project_idea_here, task, formatting):
23
  describe_your_project_idea_here = sanitize_input(describe_your_project_idea_here)
24
  describe_your_project_idea_here = limit_input_length(describe_your_project_idea_here, max_length=1000)
25
  messages = [{"role": "user", "content": prompt_injection_check_pre + describe_your_project_idea_here + prompt_injection_check_post + task + describe_your_project_idea_here + formatting}]
 
33
  def get_project_scope(describe_your_project_idea_here):
34
  task =f""" Your task is to help a university lecturer create a project scope table for """
35
  formatting = f"""Define what is the project objective, in scope, out of scope and assumptions. Do this in a tabular format. The table comprises six rows. The first row is a single column labeled "Project Objective". The second row is a single column stating the project objectives. The thid row contains two columns labeled "In Scope" and "Out of Scope". The fourth row contains two columns describing what is in scope and out of scope. The fifth row is a single column named "Assumptions". The sixth row is a single column describing the assumptions. Below each of these name, populate with detail content relevant to each title."""
36
+ return get_response_from_llm(describe_your_project_idea_here, task, formatting)
37
 
38
  def get_change_impact_assessment(describe_your_project_idea_here):
39
  task =f""" Your task is to help a university lecturer create a change impact assessment for """
40
  formatting = f"""For each of these job aspects: Processes Systems Tools Job roles Critical behaviours Mindset/Attitudes/behaviour Reporting structure Performance reviews Compensation Location, Comment on these in a tabular format: Will this job aspect be impacted by the change? What are the specific details of the impact? What roles will be impacted by the change? Support options recommended: • Consultation • Training/ Instruction • Information/messaging • Coaching/mentoring • Other"""
41
+ return get_response_from_llm(describe_your_project_idea_here, task, formatting)
 
 
 
 
 
 
 
 
 
42
 
43
  def get_scope_and_change_impact_assessment(describe_your_project_idea_here):
44
  scope = get_project_scope(describe_your_project_idea_here)