-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProfilized agents doing interviews for recruiters and candidates
224 lines (201 loc) · 13.7 KB
/
Profilized agents doing interviews for recruiters and candidates
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# Screening interview between recruiter and job candidate agents
AutoGen offers conversable agents powered by LLM, tool, or human, which can be used to perform tasks collectively via automated chat. This framework allows tool use and human participation through multi-agent conversation. Please find documentation about this feature [here](https://microsoft.github.io/autogen/docs/Use-Cases/agent_chat).
In this notebook, we demonstrate an application involving multiple agents and human users to work together and accomplish a task. `AssistantAgent` is an LLM-based agent that can write Python code (in a Python coding block) for a user to execute for a given task. `UserProxyAgent` is an agent which serves as a proxy for a user to execute the code written by `AssistantAgent`. We create multiple `UserProxyAgent` instances that can represent different human users.
## Requirements
AutoGen requires `Python>=3.8`. To run this notebook example, please install:
```bash
pip install pyautogen
```
# %pip install pyautogen~=0.2.0b4
## Set your API Endpoint
The [`config_list_from_json`](https://microsoft.github.io/autogen/docs/reference/oai/openai_utils#config_list_from_json) function loads a list of configurations from an environment variable or a json file.
It first looks for an environment variable of a specified name ("OAI_CONFIG_LIST" in this example), which needs to be a valid json string. If that variable is not found, it looks for a json file with the same name. It filters the configs by models (you can filter by other keys as well).
The json looks like the following:
```json
[
{
"model": "gpt-4",
"api_key": "<your OpenAI API key here>"
},
{
"model": "gpt-4",
"api_key": "<your Azure OpenAI API key here>",
"base_url": "<your Azure OpenAI API base here>",
"api_type": "azure",
"api_version": "2023-08-01-preview"
},
{
"model": "gpt-4-32k",
"api_key": "<your Azure OpenAI API key here>",
"base_url": "<your Azure OpenAI API base here>",
"api_type": "azure",
"api_version": "2023-08-01-preview"
}
]
```
You can set the value of config_list in any way you prefer. Please refer to this [notebook](https://github.com/microsoft/autogen/blob/main/notebook/oai_openai_utils.ipynb) for full code examples of the different methods.
import autogen
config_list = autogen.config_list_from_json(
"OAI_CONFIG_LIST",
filter_dict={
"model": ["gpt-3.5-turbo", "gpt-4", "gpt4", "gpt-4-32k", "gpt-4-32k-0314", "gpt-4-32k-v0314"],
},
)
## Construct Agents
We define `ask_candidate` function to start a conversation between two agents and return a summary of the result. We construct an assistant agent named "assistant_for_candidate" and a user proxy agent named "candidate". We specify `human_input_mode` as "TERMINATE" in the user proxy agent, the agent only prompts for human input only when a termination message is received or the number of auto reply reaches the max_consecutive_auto_reply
def ask_candidate(message):
assistant_for_candidate = autogen.AssistantAgent(
name="assistant_for_candidate",
system_message=f'''
You are a helpful assistant representing a job searching candidate doing interviews. You are chatting with a recruiter. \\
You are expected to answer the questions from the recruiter in a concise and structured format with information ONLY from the resume and provided from the candidate. \\
Awnswer the questions from recruiter in a way that makes the candidate looks qualified.\\
When if particular skill or qualification from the resume is missing from the resume, try to use existing contents to provide an answer. \\
If additional information is absolutely required to answer the question, ask the candidate. \\
This is the candidates's resume: \\
Bingchen(Benjamin) Ji
jibc@umich.edu • www.linkedin.com/in/bingchen-ji
Education
University of Michigan, Ann Arbor, MI, USA
Master of Science in Industrial and Operations Engineering, GPA 3.33/4.0 09/2021 - 12/2022
Graduate Certificate in Data Science, GPA 3.453/4.0 (top 5% fastest degree earner) 09/2021 - 12/2022
McMaster University, Hamilton, ON, Canada from 09/2016 to 04/2021
Bachelor of Engineering in Electrical and Computer Engineering (summa cum laude), GPA 3.7/4.0
Nanyang Technological University, Singapore from 08/2018 to 05/2019
Electrical Engineering and Computer Science (Global exchange scholarship), GPA 4.0/4.0
Licenses and Certifications
Decentralized Finance (DeFi): The Future of Finance [link to certification]
Duke University 08/2022
• Completed a series of 4 courses in DeFi covering infrastructure, primitives, deep dive, opportunities and risks.
Introduction to Blockchain Technologies [link to certification]
INSEAD Business School 07/2022
• Completed introductory course on blockchain technologies covering blockchain value reasoning, blockchain design principles, public and private ledgers, blockchain ecosystem, and blockchain implementation challenges.
Skills
Programming: Solidity, Python (pandas, sklearn, matplotlib, PyTorch, TensorFlow, Keras, Gurobi, nltk), MySQL, MongoDB, MATLAB, C/C++, Julia, JavaScript, Linux Bash, LaTeX, AWS, GCP, Spark, Hive, Hadoop, ROS, Jenkins(CI/CD)
Software: MS Excel, PowerPoint, PowerBI, Tableau, Git, Docker, MiniTab, ProModel, AutoCAD, SAP
Work Experiences
Reccer LLC. Ann Arbor, MI, USA
Founder from 12/22 to now
• Developing an AI-powered resume editing recommendation platform to quickly create resumes that match job descriptions.
• Conducting market exploration and research. Experimenting with the integration of GPT-3.
Continental Oceans Technology, Livonia, MI, USA
Supply Chain Analyst (intern) from 06/22 to 08/22
• Managed the set-up of a new inventory and order processing facility for pet toy retailing. Oversaw and analyzed the processes of order receiving and fulfillment on Shopify, FAIR, and Etsy e-commerce platforms.
• Developed 3 process refinement plans. Optimized the operational efficiency through simulation analysis with Python.
• Reduced average order processing time by 84% and over 20% in shipping supply costs.
CRRC Co. Ltd (largest locomotive manufacturer in the world), Las Vegas, NV & Remote, USA
Business Development Manager (Contract) from 09/21 to 11/21
• Conducted market research through 35 customer interviews as a company representative at MineExpo 2021. Analyzed technology readiness, competitive landscapes, and customer preferences in the North American mining equipment market.
• Presented to the global HQ about the research findings. Suggested R&D directions and business development strategies.
• ETF Lab at McMaster University, Hamilton, ON, Canada
Research Assistant (Co-op) from 06/20 to 08/20
• Implemented satellite and inertial sensor data fusion algorithm for vehicle navigation in C++.
• Programmed an automated computing environment configuration software, reduced computing task setup time by over 90%.
Longan Vision Corp., Hamilton, ON, Canada
AR Software Engineer (Co-op) from 08/19 to 01/20
• Developed a multi-threading adaptive augmented reality device configuration software with OpenCV in C++. Saved 20% of the manufacturing budget.
• Simulated a WLAN network and optimized the network configuration. Reduced over 40% packet loss rate for indoor settings.
Relevant Project
Blockchain At Michigan
NFT marketplace research project lead (2022 Cohort) from 06/22 to 08/22
• Led the project for NFT marketplace research and discoveries and presented the results in the cohort final projects expo.
• Analyzed transaction volume and number of users on 10 leading NFT marketplace platforms with respect to factors including NFT genre (image, music, game token, etc.), residing blockchain, and market mechanisms.
• Summarized key success factors for each leading NFT marketplace. Educated the cohort on NFT history, present landscape, and future opportunities.
'''
,
llm_config={
"temperature": 0,
"config_list": config_list,
},
)
candidate = autogen.UserProxyAgent(
name="candidate",
human_input_mode="ALWAYS",
code_execution_config={"work_dir": "candidate"},
)
candidate.initiate_chat(assistant_for_candidate, message=message)
candidate.stop_reply_at_receive(assistant_for_candidate)
# candidate.human_input_mode, candidate.max_consecutive_auto_reply = "TERMINATE", 1
# final message sent from the candidate
candidate.send("Awnswer the questions from recruiter. ", assistant_for_candidate)
# return the last message the candidate received
return candidate.last_message()["content"]
We construct another assistant agent named "assistant_for_student" and a user proxy agent named "student". We specify `human_input_mode` as "TERMINATE" in the user proxy agent, which will ask for feedback when it receives a "TERMINATE" signal from the assistant agent. We set the `functions` in `AssistantAgent` and `function_map` in `UserProxyAgent` to use the created `ask_expert` function.
For simplicity, the `ask_expert` function is defined to run locally. For real applications, the function should run remotely to interact with an expert user.
assistant_for_recruiter = autogen.AssistantAgent(
name="assistant_for_recruiter",
system_message="You are a helpful assistant that represents a recruiter looking for a talent with qualifications specified in the initial context. Ask questions to discern the authenticity of the candidates' resume. Give a result of 'QUALIFIED CANDIDATE' or 'UNQUALIFIED CANDIDATE' at the end of conversation. Reply TERMINATE when the task is done.",
llm_config={
"timeout": 600,
"cache_seed": 42,
"config_list": config_list,
"temperature": 0,
"functions": [
{
"name": "ask_candidate",
"description": "ask candidate about their qualifications when missing information to determine if they are qualified for the job.",
"parameters": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "Questions to ask the candidate to determine if they are qualified for the job. Ensure the question includes enough context, such as the skills requirements or major of study. The candidate does not know the conversation between you and the user unless you share the conversation with the candidate.",
},
},
"required": ["message"],
},
}
],
}
)
recruiter = autogen.UserProxyAgent(
name="recruiter",
human_input_mode="ALWAYS",
# max_consecutive_auto_reply=1,
code_execution_config={"work_dir": "recruiter"},
function_map={"ask_candidate": ask_candidate},
)
## Perform a task
We invoke the `initiate_chat()` method of the recruiter proxy agent to start the conversation. When you run the cell below, you will be prompted to provide feedback after the assistant agent sends a "TERMINATE" signal at the end of the message. The conversation will finish if you don't provide any feedback (by pressing Enter directly). Before the "TERMINATE" signal, the recruiter proxy agent will try to execute the code suggested by the assistant agent on behalf of the user.
# the assistant receives a message from the recruiter, which contains the task description
recruiter.initiate_chat(
assistant_for_recruiter,
message="""We are looking for a candidate fulfilling this position.
Data Scientist, Software Programs- job post
Apple
12,522 reviews
Cupertino, CA
Full-time
You must create an Indeed account before continuing to the company website to apply
Job details
Here’s how the job details align with your job preferences.
Manage job preferences anytime in your profile.
Job type
Full-time
Benefits
Pulled from the full job description
Dental insurance
Employee stock purchase plan
Health insurance
RSU
Retirement plan
Summary
Posted: Sep 11, 2023
Weekly Hours: 40
Role Number: 200501302
Imagine what you could do here. At Apple, new ideas have a way of becoming great products, services, and customer experiences very quickly. Bring passion and dedication to your job and there's no telling what you could accomplish! The System Quality team is seeking a data science engineer to help us improve software quality for iOS and macOS. We practice agile, fast-paced development that relies heavily on a tight relationship between Engineering and QA. We're looking for critical thinkers who would like to play a key role in developing new tools and processes for the SWE Program group.
Key Qualifications
Experience with distributed computation, storage, and workflow management (Cassandra, Spark, Airflow)
Experience designing, conducting, analyzing, and interpreting experiments and/or investigations
Exposure to multiple levels of the data science process (collection, cleaning, extraction, transformation, loading, analysis / inference / prediction)
Highly organized, creative, motivated, and passionate about achieving results
Excellent written, verbal, and data communication skills
Enthusiasm for user-focused design & high-quality technology
Description
On the System Quality team, we are responsible for performing ad hoc data analysis, development and maintenance of distributed data pipelines, and creation and support of analysis tools.
Education & Experience
BS/MS or equivalent experience.
""",
)
When the assistant needs to consult the expert, it suggests a function call to `ask_expert`. When this happens, a line like the following will be displayed:
***** Suggested function Call: ask_expert *****