Spaces:
Sleeping
Sleeping
Add get_interviewer_teams_in_time_slot tool
Browse files
app.py
CHANGED
@@ -64,10 +64,10 @@ def get_interviewer_teams_by_skills(
|
|
64 |
"""
|
65 |
A function to get all possible teams of interviewers by their skills.
|
66 |
Args:
|
67 |
-
team_size: int - The number of interviewers in each team.
|
68 |
-
division: str - A division interviewers belong to.
|
69 |
-
interview_level: str - A level of interview. E.g. for Junior interview level we need interviewers level Junior or higher. For Middle - Middle and higher. And so on.
|
70 |
-
skills: list - Skills that an interviewers must have to be able to conduct an interview.
|
71 |
|
72 |
Returns:
|
73 |
str: A list of interviewers teams in json.
|
@@ -80,6 +80,32 @@ def get_interviewer_teams_by_skills(
|
|
80 |
duration_hours=0,
|
81 |
skills=skills)
|
82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
def get_interviewer_teams_by_skills_in_time_slot(
|
84 |
team_size: int,
|
85 |
division: str,
|
@@ -90,12 +116,12 @@ def get_interviewer_teams_by_skills_in_time_slot(
|
|
90 |
"""
|
91 |
A function to get all possible teams of interviewers by their skills in requested time slot.
|
92 |
Args:
|
93 |
-
team_size: int - The number of interviewers in each team.
|
94 |
-
division: str - A division interviewers belong to.
|
95 |
-
interview_level: str - A level of interview. E.g. for Junior interview level we need interviewers level Junior or higher. For Middle - Middle and higher. And so on.
|
96 |
-
start_date_time: str - Date and time of start of interview.
|
97 |
-
duration_hours: int - Required duration of the availability in hours.
|
98 |
-
skills: list - Skills that an interviewers must have to be able to conduct an interview.
|
99 |
|
100 |
Returns:
|
101 |
str: A list of interviewers teams in json.
|
@@ -115,7 +141,7 @@ def get_interviewer_teams_by_skills_in_time_slot(
|
|
115 |
params += optional_params
|
116 |
|
117 |
params += "".join(f'&skills={skill}' for skill in skills)
|
118 |
-
print(params)
|
119 |
|
120 |
basic_url = "http://18.133.247.78/search/interviewerTeams"
|
121 |
url = basic_url + params
|
@@ -130,29 +156,39 @@ class GetInterviewerTeams(BaseModel):
|
|
130 |
"""
|
131 |
Pydantic arguments schema for get_interviewer_teams function
|
132 |
"""
|
133 |
-
team_size: int = Field(..., description="The number of interviewers in each team.
|
134 |
-
division: str = Field(..., description="A division interviewers belong to.
|
135 |
-
interview_level: str = Field(..., description="A level of interview. E.g. for Junior interview level we need interviewers level Junior or higher. For Middle - Middle and higher. And so on.
|
136 |
|
137 |
class GetInterviewerTeamsBySkills(BaseModel):
|
138 |
"""
|
139 |
Pydantic arguments schema for get_interviewer_teams_by_skills function
|
140 |
"""
|
141 |
-
team_size: int = Field(..., description="The number of interviewers in each team.
|
142 |
-
division: str = Field(..., description="A division interviewers belong to.
|
143 |
-
interview_level: str = Field(..., description="A level of interview. E.g. for Junior interview level we need interviewers level Junior or higher. For Middle - Middle and higher. And so on.
|
144 |
-
skills: list = Field(..., description="Skills that an interviewers must have to be able to conduct an interview.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
|
146 |
class GetInterviewerTeamsBySkillsInTimeSlot(BaseModel):
|
147 |
"""
|
148 |
Pydantic arguments schema for get_interviewer_teams_by_skills_in_time_slot function
|
149 |
"""
|
150 |
-
team_size: int = Field(..., description="The number of interviewers in each team.
|
151 |
-
division: str = Field(..., description="A division interviewers belong to.
|
152 |
-
interview_level: str = Field(..., description="A level of interview. E.g. for Junior interview level we need interviewers level Junior or higher. For Middle - Middle and higher. And so on.
|
153 |
-
start_date_time: str = Field(..., description="Date and time of start of interview.
|
154 |
-
duration_hours: int = Field(..., description="Required duration of the availability in hours.
|
155 |
-
skills: list = Field(..., description="Skills that an interviewers must have to be able to conduct an interview.
|
156 |
|
157 |
llm = ChatOpenAI(temperature=0.0, model_name="gpt-3.5-turbo", openai_api_key=OPENAI_API_KEY)
|
158 |
|
@@ -172,6 +208,11 @@ tools = [
|
|
172 |
args_schema=GetInterviewerTeamsBySkills,
|
173 |
description="A function to get all possible teams of interviewers by their skills."
|
174 |
),
|
|
|
|
|
|
|
|
|
|
|
175 |
StructuredTool.from_function(
|
176 |
func=get_interviewer_teams_by_skills_in_time_slot,
|
177 |
args_schema=GetInterviewerTeamsBySkillsInTimeSlot,
|
@@ -211,9 +252,11 @@ def predict(message, history):
|
|
211 |
|
212 |
examples = [
|
213 |
"Hello! Tell me please about yourself: who are you, what is your purpose, what tools do you have?",
|
214 |
-
"List all employees",
|
215 |
"I need a team of 2 interviewers from Java division who can interview Senior level newcomers",
|
216 |
-
"I need a team of 2 interviewers from Java division with Java and SQL skills who can interview Senior level newcomers
|
|
|
|
|
|
|
217 |
]
|
218 |
|
219 |
description = '''
|
|
|
64 |
"""
|
65 |
A function to get all possible teams of interviewers by their skills.
|
66 |
Args:
|
67 |
+
team_size: int - The number of interviewers in each team.
|
68 |
+
division: str - A division interviewers belong to.
|
69 |
+
interview_level: str - A level of interview. E.g. for Junior interview level we need interviewers level Junior or higher. For Middle - Middle and higher. And so on.
|
70 |
+
skills: list - Skills that an interviewers must have to be able to conduct an interview.
|
71 |
|
72 |
Returns:
|
73 |
str: A list of interviewers teams in json.
|
|
|
80 |
duration_hours=0,
|
81 |
skills=skills)
|
82 |
|
83 |
+
def get_interviewer_teams_in_time_slot(
|
84 |
+
team_size: int,
|
85 |
+
division: str,
|
86 |
+
interview_level: str,
|
87 |
+
start_date_time: str,
|
88 |
+
duration_hours: int) -> str:
|
89 |
+
"""
|
90 |
+
A function to get all possible teams of interviewers in requested time slot.
|
91 |
+
Args:
|
92 |
+
team_size: int - The number of interviewers in each team.
|
93 |
+
division: str - A division interviewers belong to.
|
94 |
+
interview_level: str - A level of interview. E.g. for Junior interview level we need interviewers level Junior or higher. For Middle - Middle and higher. And so on.
|
95 |
+
start_date_time: str - Date and time of start of interview.
|
96 |
+
duration_hours: int - Required duration of the availability in hours.
|
97 |
+
|
98 |
+
Returns:
|
99 |
+
str: A list of interviewers teams in json.
|
100 |
+
"""
|
101 |
+
return get_interviewer_teams_by_skills_in_time_slot(
|
102 |
+
team_size=team_size,
|
103 |
+
division=division,
|
104 |
+
interview_level=interview_level,
|
105 |
+
start_date_time=start_date_time,
|
106 |
+
duration_hours=duration_hours,
|
107 |
+
skills=[])
|
108 |
+
|
109 |
def get_interviewer_teams_by_skills_in_time_slot(
|
110 |
team_size: int,
|
111 |
division: str,
|
|
|
116 |
"""
|
117 |
A function to get all possible teams of interviewers by their skills in requested time slot.
|
118 |
Args:
|
119 |
+
team_size: int - The number of interviewers in each team.
|
120 |
+
division: str - A division interviewers belong to.
|
121 |
+
interview_level: str - A level of interview. E.g. for Junior interview level we need interviewers level Junior or higher. For Middle - Middle and higher. And so on.
|
122 |
+
start_date_time: str - Date and time of start of interview.
|
123 |
+
duration_hours: int - Required duration of the availability in hours.
|
124 |
+
skills: list - Skills that an interviewers must have to be able to conduct an interview.
|
125 |
|
126 |
Returns:
|
127 |
str: A list of interviewers teams in json.
|
|
|
141 |
params += optional_params
|
142 |
|
143 |
params += "".join(f'&skills={skill}' for skill in skills)
|
144 |
+
print(params)
|
145 |
|
146 |
basic_url = "http://18.133.247.78/search/interviewerTeams"
|
147 |
url = basic_url + params
|
|
|
156 |
"""
|
157 |
Pydantic arguments schema for get_interviewer_teams function
|
158 |
"""
|
159 |
+
team_size: int = Field(..., description="The number of interviewers in each team.")
|
160 |
+
division: str = Field(..., description="A division interviewers belong to.")
|
161 |
+
interview_level: str = Field(..., description="A level of interview. E.g. for Junior interview level we need interviewers level Junior or higher. For Middle - Middle and higher. And so on.")
|
162 |
|
163 |
class GetInterviewerTeamsBySkills(BaseModel):
|
164 |
"""
|
165 |
Pydantic arguments schema for get_interviewer_teams_by_skills function
|
166 |
"""
|
167 |
+
team_size: int = Field(..., description="The number of interviewers in each team.")
|
168 |
+
division: str = Field(..., description="A division interviewers belong to.")
|
169 |
+
interview_level: str = Field(..., description="A level of interview. E.g. for Junior interview level we need interviewers level Junior or higher. For Middle - Middle and higher. And so on.")
|
170 |
+
skills: list = Field(..., description="Skills that an interviewers must have to be able to conduct an interview.")
|
171 |
+
|
172 |
+
class GetInterviewerTeamsInTimeSlot(BaseModel):
|
173 |
+
"""
|
174 |
+
Pydantic arguments schema for get_interviewer_teams_in_time_slot function
|
175 |
+
"""
|
176 |
+
team_size: int = Field(..., description="The number of interviewers in each team.")
|
177 |
+
division: str = Field(..., description="A division interviewers belong to.")
|
178 |
+
interview_level: str = Field(..., description="A level of interview. E.g. for Junior interview level we need interviewers level Junior or higher. For Middle - Middle and higher. And so on.")
|
179 |
+
start_date_time: str = Field(..., description="Date and time of start of interview.")
|
180 |
+
duration_hours: int = Field(..., description="Required duration of the availability in hours.")
|
181 |
|
182 |
class GetInterviewerTeamsBySkillsInTimeSlot(BaseModel):
|
183 |
"""
|
184 |
Pydantic arguments schema for get_interviewer_teams_by_skills_in_time_slot function
|
185 |
"""
|
186 |
+
team_size: int = Field(..., description="The number of interviewers in each team.")
|
187 |
+
division: str = Field(..., description="A division interviewers belong to.")
|
188 |
+
interview_level: str = Field(..., description="A level of interview. E.g. for Junior interview level we need interviewers level Junior or higher. For Middle - Middle and higher. And so on.")
|
189 |
+
start_date_time: str = Field(..., description="Date and time of start of interview.")
|
190 |
+
duration_hours: int = Field(..., description="Required duration of the availability in hours.")
|
191 |
+
skills: list = Field(..., description="Skills that an interviewers must have to be able to conduct an interview.")
|
192 |
|
193 |
llm = ChatOpenAI(temperature=0.0, model_name="gpt-3.5-turbo", openai_api_key=OPENAI_API_KEY)
|
194 |
|
|
|
208 |
args_schema=GetInterviewerTeamsBySkills,
|
209 |
description="A function to get all possible teams of interviewers by their skills."
|
210 |
),
|
211 |
+
StructuredTool.from_function(
|
212 |
+
func=get_interviewer_teams_in_time_slot,
|
213 |
+
args_schema=GetInterviewerTeamsInTimeSlot,
|
214 |
+
description="A function to get all possible teams of interviewers in requested time slot."
|
215 |
+
),
|
216 |
StructuredTool.from_function(
|
217 |
func=get_interviewer_teams_by_skills_in_time_slot,
|
218 |
args_schema=GetInterviewerTeamsBySkillsInTimeSlot,
|
|
|
252 |
|
253 |
examples = [
|
254 |
"Hello! Tell me please about yourself: who are you, what is your purpose, what tools do you have?",
|
|
|
255 |
"I need a team of 2 interviewers from Java division who can interview Senior level newcomers",
|
256 |
+
"I need a team of 2 interviewers from Java division with Java and SQL skills who can interview Senior level newcomers",
|
257 |
+
"I need a team of 2 interviewers from Java division who can interview Senior level newcomers in given time slot: start time is 2024-02-12T11:00:00, duration 1 hour",
|
258 |
+
"I need a team of 2 interviewers from Java division with Java and SQL skills who can interview Senior level newcomers in given time slot: start time is 2024-02-12T11:00:00, duration 1 hour",
|
259 |
+
"List all interviewers"
|
260 |
]
|
261 |
|
262 |
description = '''
|