Spaces:
				
			
			
	
			
			
					
		Running
		
	
	
	
			
			
	
	
	
	
		
		
					
		Running
		
	Update main.py
Browse files
    	
        main.py
    CHANGED
    
    | 
         @@ -13,61 +13,8 @@ from mistralai import Mistral, UserMessage, SystemMessage 
     | 
|
| 13 | 
         
             
            from offres_emploi import Api
         
     | 
| 14 | 
         
             
            from offres_emploi.utils import dt_to_str_iso
         
     | 
| 15 | 
         
             
            os.environ["GITHUB_TOKEN"] = os.environ["GITHUB_TOKEN"]
         
     | 
| 16 | 
         
            -
             
     | 
| 17 | 
         
             
            session_id = str(uuid.uuid4())
         
     | 
| 18 | 
         | 
| 19 | 
         
            -
            from selenium import webdriver
         
     | 
| 20 | 
         
            -
            from selenium.webdriver.common.keys import Keys
         
     | 
| 21 | 
         
            -
            from selenium.webdriver import ActionChains
         
     | 
| 22 | 
         
            -
             
     | 
| 23 | 
         
            -
            from langsmith import Client
         
     | 
| 24 | 
         
            -
            os.environ["LANGCHAIN_API_KEY"] = os.environ["LANGCHAIN_API_KEY"]
         
     | 
| 25 | 
         
            -
            client = Client()
         
     | 
| 26 | 
         
            -
            project_runs_LICMIPI = client.list_runs(project_name="Master MIPI",
         
     | 
| 27 | 
         
            -
              is_root=True)
         
     | 
| 28 | 
         
            -
            driver = webdriver.Chrome()
         
     | 
| 29 | 
         
            -
            action = ActionChains(driver)
         
     | 
| 30 | 
         
            -
             
     | 
| 31 | 
         
            -
            driver.get("https://datacipen-misia.hf.space/")
         
     | 
| 32 | 
         
            -
            time.sleep(5)
         
     | 
| 33 | 
         
            -
             
     | 
| 34 | 
         
            -
             
     | 
| 35 | 
         
            -
            threads = ''
         
     | 
| 36 | 
         
            -
            for r in project_runs_LICMIPI:
         
     | 
| 37 | 
         
            -
                #print(r)
         
     | 
| 38 | 
         
            -
                threads += r.inputs['input']
         
     | 
| 39 | 
         
            -
                #print(r.outputs['output']['output'])
         
     | 
| 40 | 
         
            -
                #print(r.outputs['output']['end'])
         
     | 
| 41 | 
         
            -
                #df = pd.DataFrame(
         
     | 
| 42 | 
         
            -
                #    [r.outputs['output']]
         
     | 
| 43 | 
         
            -
                #)
         
     | 
| 44 | 
         
            -
                #print(df)
         
     | 
| 45 | 
         
            -
             
     | 
| 46 | 
         
            -
             
     | 
| 47 | 
         
            -
             
     | 
| 48 | 
         
            -
            Para_Element = driver.find_element_by_class_name("css-179rm25")
         
     | 
| 49 | 
         
            -
            #print(Para_Element.text)
         
     | 
| 50 | 
         
            -
            driver.execute_script("var ele=arguments[0]; ele.innerHTML = '" + threads + "';", Para_Element)
         
     | 
| 51 | 
         
            -
             
     | 
| 52 | 
         
            -
            #driver.execute_script("document.getElementById('myP').appendChild(document.createElement('a'))")
         
     | 
| 53 | 
         
            -
            #element = driver.find_element_by_tag_name("a")
         
     | 
| 54 | 
         
            -
            #driver.execute_script("arguments[0].setAttribute('href', 'https://www.google.com/')", element)
         
     | 
| 55 | 
         
            -
            #driver.execute_script("var ele=arguments[0]; ele.innerHTML = 'Google';", element)
         
     | 
| 56 | 
         
            -
             
     | 
| 57 | 
         
            -
            #Para_Element = driver.find_element_by_id("myP")
         
     | 
| 58 | 
         
            -
            print(Para_Element.text)
         
     | 
| 59 | 
         
            -
             
     | 
| 60 | 
         
            -
             
     | 
| 61 | 
         
            -
             
     | 
| 62 | 
         
            -
             
     | 
| 63 | 
         
            -
             
     | 
| 64 | 
         
            -
             
     | 
| 65 | 
         
            -
             
     | 
| 66 | 
         
            -
             
     | 
| 67 | 
         
            -
             
     | 
| 68 | 
         
            -
             
     | 
| 69 | 
         
            -
             
     | 
| 70 | 
         
            -
                
         
     | 
| 71 | 
         
             
            @cl.step(type="tool", show_input=True)
         
     | 
| 72 | 
         
             
            @ls.traceable(run_type="tool", name="Retrieve Context : chargement des données Gustaviz")
         
     | 
| 73 | 
         
             
            def Chargement_des_datas(profile):
         
     | 
| 
         | 
|
| 13 | 
         
             
            from offres_emploi import Api
         
     | 
| 14 | 
         
             
            from offres_emploi.utils import dt_to_str_iso
         
     | 
| 15 | 
         
             
            os.environ["GITHUB_TOKEN"] = os.environ["GITHUB_TOKEN"]
         
     | 
| 
         | 
|
| 16 | 
         
             
            session_id = str(uuid.uuid4())
         
     | 
| 17 | 
         | 
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 18 | 
         
             
            @cl.step(type="tool", show_input=True)
         
     | 
| 19 | 
         
             
            @ls.traceable(run_type="tool", name="Retrieve Context : chargement des données Gustaviz")
         
     | 
| 20 | 
         
             
            def Chargement_des_datas(profile):
         
     |