LilRg commited on
Commit
161ac77
·
verified ·
1 Parent(s): 708b2d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -151,7 +151,8 @@ def get_enterprise_descriptions():
151
  (
152
  record['fields'].get('Recruteur / Entreprise'),
153
  record['fields'].get('Compétences requises'),
154
- record['fields'].get('ID_Offre')
 
155
  )
156
  for record in data['records']
157
  ]
@@ -223,7 +224,7 @@ def upload_to_airtable(skill_assessment, student_id):
223
  logger.error(f"Erreur lors de l'envoi : {str(e)}")
224
  return f"Erreur lors de l'enregistrement : {str(e)}"
225
 
226
- def add_to_compatibility_table(student_id, skill_assessment, enterprise_skills, offer_id, compatibility_rate, student_name, student_mail):
227
  url = f"https://api.airtable.com/v0/{AIRTABLE_BASE_ID}/TauxCompatibilité"
228
  headers = {
229
  "Authorization": f"Bearer {AIRTABLE_API_KEY}",
@@ -238,7 +239,9 @@ def add_to_compatibility_table(student_id, skill_assessment, enterprise_skills,
238
  "DescriptionOffre": enterprise_skills,
239
  "Taux de compatibilité" : compatibility_rate,
240
  "Nom": student_name,
241
- "EmailEtudiant": student_mail
 
 
242
  }
243
  }
244
 
@@ -344,10 +347,10 @@ def submit_and_compare(skill_assessment_output):
344
  enterprise_descriptions = get_enterprise_descriptions()
345
  results = []
346
 
347
- for enterprise_name, enterprise_desc, offer_id in enterprise_descriptions:
348
  analysis = compare_skills_ai(skill_assessment_output, enterprise_desc)
349
 
350
- add_response = add_to_compatibility_table(student_id, skill_assessment_output, enterprise_desc, offer_id, analysis, student_name, student_mail)
351
 
352
  results.append(f"Entreprise : {enterprise_name}\n{add_response}")
353
 
 
151
  (
152
  record['fields'].get('Recruteur / Entreprise'),
153
  record['fields'].get('Compétences requises'),
154
+ record['fields'].get('ID_Offre'),
155
+ record['fields'].get('email')
156
  )
157
  for record in data['records']
158
  ]
 
224
  logger.error(f"Erreur lors de l'envoi : {str(e)}")
225
  return f"Erreur lors de l'enregistrement : {str(e)}"
226
 
227
+ def add_to_compatibility_table(student_id, skill_assessment, enterprise_skills, offer_id, compatibility_rate, student_name, student_mail, enterprise_name, emailEntreprise):
228
  url = f"https://api.airtable.com/v0/{AIRTABLE_BASE_ID}/TauxCompatibilité"
229
  headers = {
230
  "Authorization": f"Bearer {AIRTABLE_API_KEY}",
 
239
  "DescriptionOffre": enterprise_skills,
240
  "Taux de compatibilité" : compatibility_rate,
241
  "Nom": student_name,
242
+ "EmailEtudiant": student_mail,
243
+ "EmailEntreprise": emailEntreprise,
244
+ "Nom_Recruteur_Entreprise": enterprise_name
245
  }
246
  }
247
 
 
347
  enterprise_descriptions = get_enterprise_descriptions()
348
  results = []
349
 
350
+ for enterprise_name, enterprise_desc, offer_id, emailEntreprise in enterprise_descriptions:
351
  analysis = compare_skills_ai(skill_assessment_output, enterprise_desc)
352
 
353
+ add_response = add_to_compatibility_table(student_id, skill_assessment_output, enterprise_desc, offer_id, analysis, student_name, student_mail, enterprise_name, emailEntreprise)
354
 
355
  results.append(f"Entreprise : {enterprise_name}\n{add_response}")
356