datacipen commited on
Commit
a4c9060
1 Parent(s): c0a2b6f

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +8 -2
main.py CHANGED
@@ -431,6 +431,7 @@ async def chat_profile():
431
  return [
432
  cl.ChatProfile(name="Catalogue ROME - ROMESKILLS",markdown_description="Les compétences du catalogue ROME",icon="./public/favicon.png",),
433
  cl.ChatProfile(name="Classification ESCO - ESCOSKILLS",markdown_description="Les compétences de la classification ESCO",icon="./public/favicon.png",),
 
434
  ]
435
  @cl.on_chat_start
436
  async def start():
@@ -444,9 +445,11 @@ async def start():
444
  if chatProfile[1] == 'ROMESKILLS':
445
  contextChat = await homeRome()
446
  categorie = cl.user_session.set("categorie", os.environ['PINECONE_API_KEYROME'])
447
- else:
448
  contextChat = await homeEsco()
449
  categorie = cl.user_session.set("categorie", os.environ['PINECONE_API_KEYESCO'])
 
 
450
 
451
  os.environ['HUGGINGFACEHUB_API_TOKEN'] = os.environ['HUGGINGFACEHUB_API_TOKEN']
452
  repo_id = "mistralai/Mistral-7B-Instruct-v0.3"
@@ -969,7 +972,10 @@ async def setup_agent(settings):
969
  chat_profile = cl.user_session.get("chat_profile")
970
  chatProfile = chat_profile.split(' - ')
971
 
972
- await construction_NCS(competenceList, chatProfile[1])
 
 
 
973
 
974
  contextChat = cl.user_session.get("contextChatBot")
975
  if not contextChat:
 
431
  return [
432
  cl.ChatProfile(name="Catalogue ROME - ROMESKILLS",markdown_description="Les compétences du catalogue ROME",icon="./public/favicon.png",),
433
  cl.ChatProfile(name="Classification ESCO - ESCOSKILLS",markdown_description="Les compétences de la classification ESCO",icon="./public/favicon.png",),
434
+ cl.ChatProfile(name="Référentiel National des Entreprises - RNE",markdown_description="Les contacts entreprises",icon="./public/favicon.png",),
435
  ]
436
  @cl.on_chat_start
437
  async def start():
 
445
  if chatProfile[1] == 'ROMESKILLS':
446
  contextChat = await homeRome()
447
  categorie = cl.user_session.set("categorie", os.environ['PINECONE_API_KEYROME'])
448
+ elif chatProfile[1] == 'ESCOSKILLS':
449
  contextChat = await homeEsco()
450
  categorie = cl.user_session.set("categorie", os.environ['PINECONE_API_KEYESCO'])
451
+ else:
452
+ contextChat = await homeRne()
453
 
454
  os.environ['HUGGINGFACEHUB_API_TOKEN'] = os.environ['HUGGINGFACEHUB_API_TOKEN']
455
  repo_id = "mistralai/Mistral-7B-Instruct-v0.3"
 
972
  chat_profile = cl.user_session.get("chat_profile")
973
  chatProfile = chat_profile.split(' - ')
974
 
975
+ if chatProfile[1] == "ROMESKILLS" or chatProfile[1] == "ESCOSKILLS":
976
+ await construction_NCS(competenceList, chatProfile[1])
977
+ else:
978
+ await construction_NCS(competenceList, chatProfile[1])
979
 
980
  contextChat = cl.user_session.get("contextChatBot")
981
  if not contextChat: