Zekun Wu commited on
Commit
1ad6de6
·
1 Parent(s): e19912c
Files changed (2) hide show
  1. app.py +2 -2
  2. example_data.json +151 -80
app.py CHANGED
@@ -5,7 +5,7 @@ from openai import AzureOpenAI
5
  from model import invoke, create_models, configure_settings, load_documents_and_create_index, \
6
  create_chat_prompt_template, execute_query
7
 
8
- client = AzureOpenAI(azure_endpoint = "https://personality-service.openai.azure.com/",api_key=os.getenv("AZURE_OPENAI_KEY"), api_version="2024-02-15-preview")
9
 
10
 
11
  example_profile = {
@@ -161,7 +161,7 @@ def main_app():
161
 
162
  with st.chat_message("assistant"):
163
  stream = client.chat.completions.create(
164
- model="personality_gpt4",
165
  temperature=st.session_state['temperature'],
166
  max_tokens=1000, # Adjust based on desired response length
167
  frequency_penalty=0.2, # To avoid repetition
 
5
  from model import invoke, create_models, configure_settings, load_documents_and_create_index, \
6
  create_chat_prompt_template, execute_query
7
 
8
+ client = AzureOpenAI(azure_endpoint = os.environ.get("AZURE_OPENAI_ENDPOINT_RAG"),api_key=os.getenv("AZURE_OPENAI_KEY"), api_version="2024-02-15-preview")
9
 
10
 
11
  example_profile = {
 
161
 
162
  with st.chat_message("assistant"):
163
  stream = client.chat.completions.create(
164
+ model="personality_gpt4o",
165
  temperature=st.session_state['temperature'],
166
  max_tokens=1000, # Adjust based on desired response length
167
  frequency_penalty=0.2, # To avoid repetition
example_data.json CHANGED
@@ -1,83 +1,154 @@
1
  {
2
- "main_profile": {
3
- "VISION": {
4
- "score": "AVERAGE",
5
- "summary": "Sees the \u2018big picture\u2019 and maintains line of sight"
 
 
 
6
  },
7
- "INTEGRITY": {
8
- "score": "LOW",
9
- "summary": "Genuine, honest and straightforward. Authentic"
 
 
10
  },
11
- "AUTHORITY": {
12
- "score": "HIGH",
13
- "summary": "Takes charge of situations; controls and directs"
14
- },
15
- "INFLUENCE": {
16
- "score": "HIGH",
17
- "summary": "Affects how others think and feel without control or direction"
18
- },
19
- "IDEATION": {
20
- "score": "AVERAGE",
21
- "summary": "Generates original and/or innovative ideas; makes unexpected connections"
22
- },
23
- "OPPORTUNISM": {
24
- "score": "HIGH",
25
- "summary": "Alert to opportunity; prepared to seize opportunities"
26
- },
27
- "CONFIDENCE": {
28
- "score": "HIGH",
29
- "summary": "Self-belief/confidence across different domains"
30
- },
31
- "DRIVE": {
32
- "score": "HIGH",
33
- "summary": "Strong desire to accomplish goals. Propensity to act decisively and get things done."
34
- },
35
- "DISCIPLINE": {
36
- "score": "HIGH",
37
- "summary": "Planned rather than spontaneous behaviour. Attention to detail and accuracy. Organises and plans to achieve goals"
38
- },
39
- "AGILITY": {
40
- "score": "AVERAGE",
41
- "summary": "Switches easily between different cognitive processes. Comfortable with ill-defined problems and situations. Adaptable and constructive."
42
- },
43
- "RESILIENCE": {
44
- "score": "HIGH",
45
- "summary": "Remains calm and optimistic under pressure. Perseveres in the face of adversity. Recovers from setbacks."
46
- }
47
- },
48
- "red_flag": {
49
- "HUBRIS": {
50
- "score": "HIGH",
51
- "summary": "Conceit and self-importance. Overestimation of knowledge and/or ability in respect of tasks. Misplaced belief in unique or exceptional abilities"
52
- },
53
- "NARCISSISTIC": {
54
- "score": "HIGH",
55
- "summary": "Need and seek attention, flattery and affirmation. Unable to recognise and/or understand the feelings and needs of others. Expectation of special treatment"
56
- },
57
- "MERCURIAL": {
58
- "score": "LOW",
59
- "summary": "Given to sudden changes of mood, behaviour or direction. Given to unconventional or strange behaviour or beliefs. Difficult to predict and/or surprising."
60
- },
61
- "DOMINANT": {
62
- "score": "HIGH",
63
- "summary": "Forceful, insistent, domineering. Hostile and argumentative. Unyielding in the face of evidence or argument."
64
- },
65
- "MACHIAVELLIAN": {
66
- "score": "AVERAGE",
67
- "summary": "Deliberate deceitfulness in the pursuit on one\u2019s interest; acting in bad faith. Ruthless pursuit of own interests regardless of considerations of right or wrong. General distrust of the motives of others; attribution of bad faith."
68
- },
69
- "RECKLESS": {
70
- "score": "AVERAGE",
71
- "summary": "Acts without forethought. Acts without sufficient regard for consequences; rash. Fails to take proper care."
72
- }
73
- },
74
- "bio_information": {
75
- "Name": "Pierre",
76
- "Gender": "Male",
77
- "Age": 42,
78
- "Nationality": "French",
79
- "Role": "Chief Executive",
80
- "Years_in_role": 2,
81
- "Years_in_comparable_role": 8
82
- }
83
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  {
2
+ "Description": {
3
+ "MAIN PROFILE DESCRIPTIONS": {
4
+ "VISION": "Sees the ‘big picture’ and maintains line of sight. Alignment of goals and actions",
5
+ "IDEATION": "Generates original and/or innovative ideas; makes unexpected connections",
6
+ "OPPORTUNISM": "Alert to opportunity; prepared to seize opportunities",
7
+ "DRIVE": "Strong desire to accomplish goals, Propensity to act decisively and get things done; proactive rather than reactive",
8
+ "RESILIENCE": "Remains calm and optimistic under pressure, Perseveres in the face of adversity, Recovers from setbacks"
9
  },
10
+ "RED FLAG DESCRIPTIONS": {
11
+ "HUBRIS": "Conceit and self-importance, Overestimation of knowledge and/or ability in respect of tasks, Misplaced belief in unique or exceptional abilities",
12
+ "MERCURIAL": "Given to sudden changes of mood, behaviour or direction, Given to unconventional or strange behaviour or beliefs, Difficult to predict and/or surprising",
13
+ "DOMINANT": "Forceful, insistent, domineering, Hostile and argumentative, Unyielding in the face of evidence or argument",
14
+ "MACHIAVELLIAN": "Deliberate deceitfulness in the pursuit on one’s interest; acting in bad faith, Ruthless pursuit of own interests regardless of considerations of right or wrong, General distrust of the motives of others; attribution of bad faith"
15
  },
16
+ "Team": [
17
+ {
18
+ "name": "JAMES ARTHUR",
19
+ "main_profile": {
20
+ "VISION": {
21
+ "score": "HIGH"
22
+ },
23
+ "IDEATION": {
24
+ "score": "HIGH"
25
+ },
26
+ "OPPORTUNISM": {
27
+ "score": "HIGH"
28
+ },
29
+ "DRIVE": {
30
+ "score": "HIGH"
31
+ },
32
+ "RESILIENCE": {
33
+ "score": "HIGH"
34
+ }
35
+ },
36
+ "red_flag": {
37
+ "HUBRIS": {
38
+ "score": "HIGH"
39
+ },
40
+ "MERCURIAL": {
41
+ "score": "LOW"
42
+ },
43
+ "DOMINANT": {
44
+ "score": "HIGH"
45
+ },
46
+ "MACHIAVELLIAN": {
47
+ "score": "AVERAGE"
48
+ }
49
+ }
50
+ },
51
+ {
52
+ "name": "LOUSIE HART",
53
+ "main_profile": {
54
+ "VISION": {
55
+ "score": "AVERAGE"
56
+ },
57
+ "IDEATION": {
58
+ "score": "AVERAGE"
59
+ },
60
+ "OPPORTUNISM": {
61
+ "score": "AVERAGE"
62
+ },
63
+ "DRIVE": {
64
+ "score": "HIGH"
65
+ },
66
+ "RESILIENCE": {
67
+ "score": "HIGH"
68
+ }
69
+ },
70
+ "red_flag": {
71
+ "HUBRIS": {
72
+ "score": "AVERAGE"
73
+ },
74
+ "MERCURIAL": {
75
+ "score": "LOW"
76
+ },
77
+ "DOMINANT": {
78
+ "score": "HIGH"
79
+ },
80
+ "MACHIAVELLIAN": {
81
+ "score": "LOW"
82
+ }
83
+ }
84
+ },
85
+ {
86
+ "name": "SIMONE LEVY",
87
+ "main_profile": {
88
+ "VISION": {
89
+ "score": "LOW"
90
+ },
91
+ "IDEATION": {
92
+ "score": "AVERAGE"
93
+ },
94
+ "OPPORTUNISM": {
95
+ "score": "LOW"
96
+ },
97
+ "DRIVE": {
98
+ "score": "AVERAGE"
99
+ },
100
+ "RESILIENCE": {
101
+ "score": "LOW"
102
+ }
103
+ },
104
+ "red_flag": {
105
+ "HUBRIS": {
106
+ "score": "LOW"
107
+ },
108
+ "MERCURIAL": {
109
+ "score": "LOW"
110
+ },
111
+ "DOMINANT": {
112
+ "score": "LOW"
113
+ },
114
+ "MACHIAVELLIAN": {
115
+ "score": "LOW"
116
+ }
117
+ }
118
+ },
119
+ {
120
+ "name": "Uri Lef",
121
+ "main_profile": {
122
+ "VISION": {
123
+ "score": "HIGH"
124
+ },
125
+ "IDEATION": {
126
+ "score": "HIGH"
127
+ },
128
+ "OPPORTUNISM": {
129
+ "score": "HIGH"
130
+ },
131
+ "DRIVE": {
132
+ "score": "AVERAGE"
133
+ },
134
+ "RESILIENCE": {
135
+ "score": "LOW"
136
+ }
137
+ },
138
+ "red_flag": {
139
+ "HUBRIS": {
140
+ "score": "AVERAGE"
141
+ },
142
+ "MERCURIAL": {
143
+ "score": "HIGH"
144
+ },
145
+ "DOMINANT": {
146
+ "score": "HIGH"
147
+ },
148
+ "MACHIAVELLIAN": {
149
+ "score": "AVERAGE"
150
+ }
151
+ }
152
+ }
153
+ }
154
+ }