datacipen commited on
Commit
246c01e
1 Parent(s): 70e66ce

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +8 -7
main.py CHANGED
@@ -460,10 +460,8 @@ async def start():
460
  cl.user_session.set("runnable", runnable)
461
 
462
  @literal_client.step(type="run")
463
- async def construction_NCS(competenceList):
464
- chat_profile = cl.user_session.get("chat_profile")
465
- chatProfile = chat_profile.split(' - ')
466
- context = await contexte(competenceList, chatProfile[1])
467
  emploisST = context.to_string(index = False)
468
  if chatProfile[1] == 'ROMESKILLS':
469
  romeListArray = cl.user_session.get("codeRomeArray")
@@ -529,8 +527,8 @@ async def recuperation_contexte(getNote):
529
  return getNote + " :\n" + getContext
530
  @cl.step(type="retrieval")
531
  async def contexte(competence, chatProfile):
532
- chat_profile = cl.user_session.get("chat_profile")
533
- chatProfile = chat_profile.split(' - ')
534
  if chatProfile == 'ROMESKILLS':
535
  results = await creation_liste_code_Rome(competence, cl.user_session.get("categorie"))
536
  else:
@@ -888,7 +886,10 @@ async def setup_agent(settings):
888
  if not cl.user_session.get("saveMemory"):
889
  cl.user_session.set("saveMemory", "")
890
 
891
- await construction_NCS(competenceList)
 
 
 
892
 
893
  contextChat = cl.user_session.get("contextChatBot")
894
  if not contextChat:
 
460
  cl.user_session.set("runnable", runnable)
461
 
462
  @literal_client.step(type="run")
463
+ async def construction_NCS(competenceList, chatProfile):
464
+ context = await contexte(competenceList, chatProfile)
 
 
465
  emploisST = context.to_string(index = False)
466
  if chatProfile[1] == 'ROMESKILLS':
467
  romeListArray = cl.user_session.get("codeRomeArray")
 
527
  return getNote + " :\n" + getContext
528
  @cl.step(type="retrieval")
529
  async def contexte(competence, chatProfile):
530
+ #chat_profile = cl.user_session.get("chat_profile")
531
+ #chatProfile = chat_profile.split(' - ')
532
  if chatProfile == 'ROMESKILLS':
533
  results = await creation_liste_code_Rome(competence, cl.user_session.get("categorie"))
534
  else:
 
886
  if not cl.user_session.get("saveMemory"):
887
  cl.user_session.set("saveMemory", "")
888
 
889
+ chat_profile = cl.user_session.get("chat_profile")
890
+ chatProfile = chat_profile.split(' - ')
891
+
892
+ await construction_NCS(competenceList, chatProfile[1])
893
 
894
  contextChat = cl.user_session.get("contextChatBot")
895
  if not contextChat: