jeanflop commited on
Commit
86c00c7
·
verified ·
1 Parent(s): 24c617c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -5
app.py CHANGED
@@ -9,14 +9,44 @@ from Gradio_UI import GradioUI
9
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
11
  @tool
12
- def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
13
  #Keep this format for the description / args / args description but feel free to modify the tool
14
- """A tool that does nothing yet
15
  Args:
16
- arg1: the first argument
17
- arg2: the second argument
18
  """
19
- return "What magic will you build ?"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  @tool
22
  def get_current_time_in_timezone(timezone: str) -> str:
 
9
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
11
  @tool
12
+ def my_custom_tool(arg1:str)-> dict: #it's import to specify the return type
13
  #Keep this format for the description / args / args description but feel free to modify the tool
14
+ """A tool that fetches jobs offers located in France from linkedin website
15
  Args:
16
+ arg1: A string representing a job position that the user looking for (e.g,'data scientis','marketing', 'pilote')
 
17
  """
18
+
19
+ url = "https://fresh-linkedin-profile-data.p.rapidapi.com/search-jobs"
20
+
21
+ payload = {
22
+ "keywords": ,arg1
23
+ "geo_code": 105015875,
24
+ "date_posted": "Any time",
25
+ "experience_levels": [],
26
+ "title_ids": [],
27
+ "onsite_remotes": [],
28
+ "functions": [],
29
+ "industries": [],
30
+ "job_types": [],
31
+ "sort_by": "Most relevant",
32
+ "easy_apply": "false",
33
+ "under_10_applicants": "false",
34
+ "start": 0
35
+ }
36
+
37
+ try:
38
+ headers = {
39
+ "x-rapidapi-key": "7aecb4cbd6msha8da9af808d2e76p13d68fjsn9c8adf856ba2",
40
+ "x-rapidapi-host": "fresh-linkedin-profile-data.p.rapidapi.com",
41
+ "Content-Type": "application/json"
42
+ }
43
+
44
+ response = requests.post(url, json=payload, headers=headers)
45
+ return response.data
46
+
47
+ except Exception as e:
48
+ return f"Error fetching time for timezone'{timezone}':{str(e)}'
49
+
50
 
51
  @tool
52
  def get_current_time_in_timezone(timezone: str) -> str: