neependra commited on
Commit
ba425c7
·
verified ·
1 Parent(s): 29b5547

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -7
app.py CHANGED
@@ -10,7 +10,7 @@ api_key = os.getenv("openai_api_key")
10
  client = OpenAI(api_key=api_key)
11
 
12
  # Function to generate game cards based on job profile
13
- def generate_game_cards(job_profile):
14
  system_message = """You are an interactive career card developer.
15
  Generate a plain-text game card for any career.
16
  The response should NOT contain Markdown formatting.
@@ -18,12 +18,40 @@ def generate_game_cards(job_profile):
18
  Keep the text structured but in simple plain text format.
19
  """
20
 
21
- user_message = f"""Generate a complete set of game cards for the career {job_profile}. The output should include the following:
22
- Career Card:
23
- - Title: The job title.
24
- - Overview: A short description of the role.
25
- - Pros & Cons: List 3-4 key pros and cons in full sentences.
26
- - Dual Impact Highlights: Explain how this career affects personal growth (skills, satisfaction) and community impact (society, economy).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  """
28
 
29
  response = client.chat.completions.create(
 
10
  client = OpenAI(api_key=api_key)
11
 
12
  # Function to generate game cards based on job profile
13
+ def generate_game_cards(JobProfileName):
14
  system_message = """You are an interactive career card developer.
15
  Generate a plain-text game card for any career.
16
  The response should NOT contain Markdown formatting.
 
18
  Keep the text structured but in simple plain text format.
19
  """
20
 
21
+ user_message = f"""
22
+ Generate a complete set of game cards for the career {JobProfileName}. The output should include the following:
23
+ Career Card:
24
+ Title: {JobProfileName}
25
+ Overview: Provide a brief description explaining the role, responsibilities, and significance of a {JobProfileName}.
26
+ Pros & Cons: List 3–4 key pros and cons.
27
+ Dual Impact Highlights: Summarize how this career affects personal growth (e.g., satisfaction, skill development) and community impact (e.g., societal contributions, local development).
28
+ Level 1 Scenario Cards: (Entry-Level Challenges)
29
+ Scenario Card 1:
30
+ Title: e.g., 'Initial Challenge 1'
31
+ Description: Describe a basic challenge or opportunity typical for an entry-level {JobProfileName}.
32
+ Decision Cards:
33
+ Option A: Describe an action choice, then include outcomes (e.g., 'Personal Impact: +X, Community Impact: +Y').
34
+ Option B: Describe an alternative action choice, then include outcomes (e.g., 'Personal Impact: +A, Community Impact: +B').
35
+ Scenario Card 2:
36
+ Title: e.g., 'Initial Challenge 2'
37
+ Description: Describe a second basic scenario for a beginner-level {JobProfileName}.
38
+ Decision Cards:
39
+ Option A: Provide an action choice with outcomes (e.g., 'Personal Impact: +X2, Community Impact: +Y2').
40
+ Option B: Provide an alternative action choice with outcomes (e.g., 'Personal Impact: +A2, Community Impact: +B2').
41
+ Level 2 Scenario Cards: (Advanced-Level Challenges)
42
+ Scenario Card 1:
43
+ Title: e.g., 'Advanced Challenge 1'
44
+ Description: Describe a more complex challenge that a {JobProfileName} might face as responsibilities increase.
45
+ Decision Cards:
46
+ Option A: Provide an action choice with outcomes (e.g., 'Personal Impact: +X3, Community Impact: +Y3').
47
+ Option B: Provide an alternative action choice with outcomes (e.g., 'Personal Impact: +A3, Community Impact: +B3').
48
+ Scenario Card 2:
49
+ Title: e.g., 'Advanced Challenge 2'
50
+ Description: Describe a second complex scenario for an advanced-level {JobProfileName}.
51
+ Decision Cards:
52
+ Option A: Provide an action choice with outcomes (e.g., 'Personal Impact: +X4, Community Impact: +Y4').
53
+ Option B: Provide an alternative action choice with outcomes (e.g., 'Personal Impact: +A4, Community Impact: +B4').
54
+ Ensure that the design includes clear labels (such as 'Career Card', 'Level 1 Scenario', 'Level 2 Scenario', 'Decision Card'), along with visual cues like icons for Personal Impact (e.g., a star) and Community Impact (e.g., a group or community icon). The tone should be engaging and accessible for a 12–16-year-old audience.
55
  """
56
 
57
  response = client.chat.completions.create(