@@ -122,8 +122,7 @@ class CandidateProfile(BaseModel):
122122 job_category_match = fc .coalesce (fc .tool_param ("job_category_query" , StringType ).is_in (fc .col ("job_category" )), fc .lit (True ))
123123 merged_filter = education_match & seniority_match & skills_match & experience_match & job_category_match
124124 search_candidates = candidates_df .filter (merged_filter ).select ("candidate_id" , "first_name" , "last_name" , "education" , "seniority" , "skills" , "experience" , "job_category" )
125- if local_session .catalog .describe_tool ("search_candidates" ):
126- local_session .catalog .drop_tool ("search_candidates" )
125+ local_session .catalog .drop_tool ("search_candidates" )
127126 local_session .catalog .create_tool (
128127 "search_candidates" ,
129128 "Search candidates by education, seniority, skills, and experience using regex patterns." ,
@@ -140,8 +139,7 @@ class CandidateProfile(BaseModel):
140139
141140 # Tool 2: candidate_resumes_by_candidate_ids -- given a list of candidate ids, return the raw resumes for each candidate
142141 candidate_resumes = candidates_df .filter (fc .col ("candidate_id" ).is_in (fc .tool_param ("candidate_ids" , fc .ArrayType (element_type = IntegerType )))).select ("candidate_id" , "candidate_resume" )
143- if local_session .catalog .describe_tool ("candidate_resumes_by_candidate_ids" ):
144- local_session .catalog .drop_tool ("candidate_resumes_by_candidate_ids" )
142+ local_session .catalog .drop_tool ("candidate_resumes_by_candidate_ids" )
145143 local_session .catalog .create_tool (
146144 "candidate_resumes_by_candidate_ids" ,
147145 "Return the raw resumes for a list of candidate ids." ,
@@ -208,8 +206,7 @@ class CandidateProfile(BaseModel):
208206 )
209207 job_category_match = fc .coalesce (fc .tool_param ("job_category_query" , StringType ).is_in (fc .col ("job_category" )), fc .lit (True ))
210208 candidates_for_job = candidates_df .filter (job_category_match ).filter (fit_pred ).select ("candidate_id" , "first_name" , "last_name" , "education" , "seniority" , "skills" , "experience" , "job_category" )
211- if local_session .catalog .describe_tool ("candidates_for_job_description" ):
212- local_session .catalog .drop_tool ("candidates_for_job_description" )
209+ local_session .catalog .drop_tool ("candidates_for_job_description" )
213210 local_session .catalog .create_tool (
214211 "candidates_for_job_description" ,
215212 "Find candidates who are a good fit for a free-form job description using structured profiles." ,
@@ -279,8 +276,7 @@ class CandidateProfile(BaseModel):
279276 ).alias ("email" ),
280277 )
281278 # Filter to a single candidate_id at runtime
282- if local_session .catalog .describe_tool ("create_outreach_for_candidate" ):
283- local_session .catalog .drop_tool ("create_outreach_for_candidate" )
279+ local_session .catalog .drop_tool ("create_outreach_for_candidate" )
284280 local_session .catalog .create_tool (
285281 "create_outreach_for_candidate" ,
286282 "Create a personalized recruiting email for a candidate using resume and cover letter context." ,
0 commit comments