Update main.py
Browse files
main.py
CHANGED
@@ -848,14 +848,14 @@ async def construction_NCS(romeListArray):
|
|
848 |
ficheMetiers = []
|
849 |
for i in range(0,len(codeArray)):
|
850 |
ficheMetiers = [
|
851 |
-
cl.File(name= "Fiche métier " + codeArray[i],url="https://
|
852 |
]
|
853 |
await cl.Message(
|
854 |
author="Datapcc : 🌐🌐🌐", content="[Fiches métiers] 🔗", elements=ficheMetiers
|
855 |
).send()
|
856 |
else:
|
857 |
ficheMetiers = [
|
858 |
-
cl.File(name= "Fiche métier " + romeListArray[0],url="https://
|
859 |
]
|
860 |
await cl.Message(
|
861 |
author="Datapcc : 🌐🌐🌐", content="[Fiches métiers] 🔗", elements=ficheMetiers
|
@@ -900,7 +900,7 @@ async def contexte(romeListArray):
|
|
900 |
emplois.append("\nEmploi : " + results[i]['intitule'] + "; Contrat : " + results[i]['typeContrat'] + "; Compétences professionnelles : " + arrayToString(results[i]['competences']) if listToString(results[i]).find("'competences':")!=-1 else "; " + "Salaire : " + listToString(results[i]['salaire']) + "; Qualification : " + results[i]['qualificationLibelle'] if listToString(results[i]).find("'qualificationLibelle':")!=-1 else "; " + "; Localisation : " + listToString(results[i]['lieuTravail']) + "; Entreprise : " + listToString(results[i]['entreprise']['nom']) if listToString(results[i]['entreprise']).find("'nom':")!=-1 else "; ")
|
901 |
emplois_list = ''.join(emplois)
|
902 |
context = emplois_list.replace('[','').replace(']','').replace('{','').replace('}','')
|
903 |
-
ficheMetier = await Fiche_metier("https://
|
904 |
ficheMetiersCompetencesSavoirs = await Fiche_metier_competences_savoirs(romeListArray[0])
|
905 |
#metierSecteurContexteTravail = await Metier_secteur_contexte_travail(romeListArray[0])
|
906 |
cl.user_session.set("EmploiST", context)
|
@@ -992,17 +992,17 @@ async def Fiche_metier(url, codes):
|
|
992 |
if codes.find(',') != -1:
|
993 |
codeArray = codes.split(',')
|
994 |
for i in range(0,len(codeArray)):
|
995 |
-
response = requests.get(url + codeArray[i])
|
996 |
if response:
|
997 |
-
loader = PyPDFLoader(url + codeArray[i])
|
998 |
documents = loader.load()
|
999 |
docs.append(text_splitter.split_documents(documents))
|
1000 |
for j in range(0,len(docs)):
|
1001 |
docs_string += docs[j][0].page_content
|
1002 |
else:
|
1003 |
-
response = requests.get(url + codes)
|
1004 |
if response:
|
1005 |
-
loader = PyPDFLoader(url + codes)
|
1006 |
documents = loader.load()
|
1007 |
docs = text_splitter.split_documents(documents)
|
1008 |
docs_string = docs[0].page_content
|
|
|
848 |
ficheMetiers = []
|
849 |
for i in range(0,len(codeArray)):
|
850 |
ficheMetiers = [
|
851 |
+
cl.File(name= "Fiche métier " + codeArray[i],url="https://www.soi-tc.fr/assets/fiches_pe/FEM_" + codeArray[i] + ".pdf",display="inline",)
|
852 |
]
|
853 |
await cl.Message(
|
854 |
author="Datapcc : 🌐🌐🌐", content="[Fiches métiers] 🔗", elements=ficheMetiers
|
855 |
).send()
|
856 |
else:
|
857 |
ficheMetiers = [
|
858 |
+
cl.File(name= "Fiche métier " + romeListArray[0],url="https://www.soi-tc.fr/assets/fiches_pe/FEM_" + romeListArray[0] + ".pdf",display="inline",)
|
859 |
]
|
860 |
await cl.Message(
|
861 |
author="Datapcc : 🌐🌐🌐", content="[Fiches métiers] 🔗", elements=ficheMetiers
|
|
|
900 |
emplois.append("\nEmploi : " + results[i]['intitule'] + "; Contrat : " + results[i]['typeContrat'] + "; Compétences professionnelles : " + arrayToString(results[i]['competences']) if listToString(results[i]).find("'competences':")!=-1 else "; " + "Salaire : " + listToString(results[i]['salaire']) + "; Qualification : " + results[i]['qualificationLibelle'] if listToString(results[i]).find("'qualificationLibelle':")!=-1 else "; " + "; Localisation : " + listToString(results[i]['lieuTravail']) + "; Entreprise : " + listToString(results[i]['entreprise']['nom']) if listToString(results[i]['entreprise']).find("'nom':")!=-1 else "; ")
|
901 |
emplois_list = ''.join(emplois)
|
902 |
context = emplois_list.replace('[','').replace(']','').replace('{','').replace('}','')
|
903 |
+
ficheMetier = await Fiche_metier("https://www.soi-tc.fr/assets/fiches_pe/FEM_", romeListArray[0])
|
904 |
ficheMetiersCompetencesSavoirs = await Fiche_metier_competences_savoirs(romeListArray[0])
|
905 |
#metierSecteurContexteTravail = await Metier_secteur_contexte_travail(romeListArray[0])
|
906 |
cl.user_session.set("EmploiST", context)
|
|
|
992 |
if codes.find(',') != -1:
|
993 |
codeArray = codes.split(',')
|
994 |
for i in range(0,len(codeArray)):
|
995 |
+
response = requests.get(url + codeArray[i] + '.pdf')
|
996 |
if response:
|
997 |
+
loader = PyPDFLoader(url + codeArray[i] + '.pdf')
|
998 |
documents = loader.load()
|
999 |
docs.append(text_splitter.split_documents(documents))
|
1000 |
for j in range(0,len(docs)):
|
1001 |
docs_string += docs[j][0].page_content
|
1002 |
else:
|
1003 |
+
response = requests.get(url + codes + '.pdf')
|
1004 |
if response:
|
1005 |
+
loader = PyPDFLoader(url + codes + '.pdf')
|
1006 |
documents = loader.load()
|
1007 |
docs = text_splitter.split_documents(documents)
|
1008 |
docs_string = docs[0].page_content
|