Phoenix21 commited on
Commit
6887e24
·
verified ·
1 Parent(s): f5759ff

Update chain_recommendations.py

Browse files
Files changed (1) hide show
  1. chain_recommendations.py +10 -2
chain_recommendations.py CHANGED
@@ -9,6 +9,13 @@ improved_recommend_prompt_template = PromptTemplate(
9
  template=(
10
  "You are a wellness recommendation assistant. Given the following problem severity percentages:\n"
11
  "{problems}\n\n"
 
 
 
 
 
 
 
12
  "Carefully analyze these percentages and consider nuanced differences between the areas. "
13
  "Your goal is to recommend the most appropriate wellness packages based on a detailed assessment of these numbers, "
14
  "not just fixed thresholds. Consider the following guidelines:\n\n"
@@ -17,11 +24,12 @@ improved_recommend_prompt_template = PromptTemplate(
17
  "- If all areas are moderate (between 30 and 70), recommend a balanced wellness package that addresses overall health.\n"
18
  "- If all areas are low, a general wellness package might be sufficient.\n"
19
  "- Consider borderline cases and recommend packages that address both current issues and preventive measures.\n\n"
20
- "Return the recommended wellness packages in a JSON array format."
 
 
21
  )
22
  )
23
 
24
- # Initialize the improved recommendation chain
25
  recommend_chain = LLMChain(llm=chat_model, prompt=improved_recommend_prompt_template)
26
 
27
  def generate_recommendations(problems: Dict[str, float]) -> str:
 
9
  template=(
10
  "You are a wellness recommendation assistant. Given the following problem severity percentages:\n"
11
  "{problems}\n\n"
12
+ "Based on these percentages and the available wellness packages:\n"
13
+ "1. Fitness & Mobility | Tagline: 'Enhance Mobility. Boost Fitness.'\n"
14
+ "2. No More Insomnia | Deep Rest | Tagline: 'Reclaim Your Sleep. Restore Your Mind.'\n"
15
+ "3. Focus Flow | Clarity Boost | Tagline: 'Stay Focused. Stay Productive.'\n"
16
+ "4. Boost Energy | Tagline: 'Fuel Your Day. Boost Your Energy.'\n"
17
+ "5. Chronic Care | Chronic Support | Tagline: 'Ongoing Support for Chronic Wellness.'\n"
18
+ "6. Mental Wellness | Calm Mind | Tagline: 'Find Peace of Mind, Every Day.'\n\n"
19
  "Carefully analyze these percentages and consider nuanced differences between the areas. "
20
  "Your goal is to recommend the most appropriate wellness packages based on a detailed assessment of these numbers, "
21
  "not just fixed thresholds. Consider the following guidelines:\n\n"
 
24
  "- If all areas are moderate (between 30 and 70), recommend a balanced wellness package that addresses overall health.\n"
25
  "- If all areas are low, a general wellness package might be sufficient.\n"
26
  "- Consider borderline cases and recommend packages that address both current issues and preventive measures.\n\n"
27
+ "Return the recommended wellness packages in a JSON array format. "
28
+ "Each item should be exactly one of the following package names: "
29
+ "\"Fitness & Mobility\", \"No More Insomnia\", \"Focus Flow\", \"Boost Energy\", \"Chronic Care\", \"Mental Wellness\"."
30
  )
31
  )
32
 
 
33
  recommend_chain = LLMChain(llm=chat_model, prompt=improved_recommend_prompt_template)
34
 
35
  def generate_recommendations(problems: Dict[str, float]) -> str: