Update main.py
Browse files
main.py
CHANGED
@@ -809,6 +809,7 @@ async def construction_FCS(romeListArray,settings):
|
|
809 |
|
810 |
@literal_client.step(type="run")
|
811 |
async def construction_NCS(romeListArray):
|
|
|
812 |
context = await contexte(romeListArray)
|
813 |
emploisST = cl.user_session.get("EmploiST")
|
814 |
memory = ConversationBufferMemory(return_messages=True)
|
@@ -898,7 +899,7 @@ async def recuperation_contexte(getNote):
|
|
898 |
return getNote + " :\n" + getContext
|
899 |
@cl.step(type="retrieval")
|
900 |
async def contexte(romeListArray):
|
901 |
-
results = await
|
902 |
index = await vectorDatabase_connexion()
|
903 |
emplois = []
|
904 |
for i in range(0,len(results)):
|
@@ -1154,7 +1155,7 @@ async def vectorDatabase_connexion():
|
|
1154 |
return index
|
1155 |
|
1156 |
@cl.step(type="tool")
|
1157 |
-
async def
|
1158 |
client = Api(client_id=os.environ['POLE_EMPLOI_CLIENT_ID'],
|
1159 |
client_secret=os.environ['POLE_EMPLOI_CLIENT_SECRET'])
|
1160 |
todayDate = datetime.datetime.today()
|
@@ -1162,7 +1163,6 @@ async def API_connexion(romeListArray):
|
|
1162 |
start_dt = todayDate.replace(day=1, month=month, year=year)
|
1163 |
end_dt = datetime.datetime.today()
|
1164 |
params = {"motsCles": romeListArray[0],'lieux':'75D','minCreationDate': dt_to_str_iso(start_dt),'maxCreationDate': dt_to_str_iso(end_dt),'range':'0-149'}
|
1165 |
-
print(romeListArray[0])
|
1166 |
search_on_big_data = client.search(params=params)
|
1167 |
results = search_on_big_data["resultats"]
|
1168 |
return results
|
|
|
809 |
|
810 |
@literal_client.step(type="run")
|
811 |
async def construction_NCS(romeListArray):
|
812 |
+
print(romeListArray[0])
|
813 |
context = await contexte(romeListArray)
|
814 |
emploisST = cl.user_session.get("EmploiST")
|
815 |
memory = ConversationBufferMemory(return_messages=True)
|
|
|
899 |
return getNote + " :\n" + getContext
|
900 |
@cl.step(type="retrieval")
|
901 |
async def contexte(romeListArray):
|
902 |
+
results = await API_FranceTravail(romeListArray)
|
903 |
index = await vectorDatabase_connexion()
|
904 |
emplois = []
|
905 |
for i in range(0,len(results)):
|
|
|
1155 |
return index
|
1156 |
|
1157 |
@cl.step(type="tool")
|
1158 |
+
async def API_FranceTravail(romeListArray):
|
1159 |
client = Api(client_id=os.environ['POLE_EMPLOI_CLIENT_ID'],
|
1160 |
client_secret=os.environ['POLE_EMPLOI_CLIENT_SECRET'])
|
1161 |
todayDate = datetime.datetime.today()
|
|
|
1163 |
start_dt = todayDate.replace(day=1, month=month, year=year)
|
1164 |
end_dt = datetime.datetime.today()
|
1165 |
params = {"motsCles": romeListArray[0],'lieux':'75D','minCreationDate': dt_to_str_iso(start_dt),'maxCreationDate': dt_to_str_iso(end_dt),'range':'0-149'}
|
|
|
1166 |
search_on_big_data = client.search(params=params)
|
1167 |
results = search_on_big_data["resultats"]
|
1168 |
return results
|