Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,6 +40,27 @@ COUNTRY_CHOICES = [
|
|
| 40 |
|
| 41 |
@mcp.tool(name="search_jobs")
|
| 42 |
def search_jobs_tool(industry: str = "", country: str = "", keyword: str = "", limit: int = 20) -> dict:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
base = "https://jobicy.com/api/v2/remote-jobs"
|
| 44 |
params = {"count": max(1, min(limit, 50))}
|
| 45 |
if industry:
|
|
@@ -84,7 +105,7 @@ def search_jobs_tool(industry: str = "", country: str = "", keyword: str = "", l
|
|
| 84 |
sorted_jobs = sorted(jobs_raw, key=lambda x: x.get("pubDate", ""), reverse=True)[:params["count"]]
|
| 85 |
return {"jobs": [fmt(j) for j in sorted_jobs]}
|
| 86 |
|
| 87 |
-
def
|
| 88 |
"""
|
| 89 |
Search remote jobs from the Jobicy API with optional filters.
|
| 90 |
|
|
|
|
| 40 |
|
| 41 |
@mcp.tool(name="search_jobs")
|
| 42 |
def search_jobs_tool(industry: str = "", country: str = "", keyword: str = "", limit: int = 20) -> dict:
|
| 43 |
+
"""
|
| 44 |
+
Search remote jobs from the Jobicy API with optional filters.
|
| 45 |
+
Parameters:
|
| 46 |
+
industry (str): Company industry to filter jobs by (e.g., 'business', 'design-multimedia').
|
| 47 |
+
Leave empty to include all industries.
|
| 48 |
+
country (str): Region or country to filter jobs by (e.g., 'usa', 'canada').
|
| 49 |
+
Leave empty or 'anywhere' to include all locations.
|
| 50 |
+
keyword (str): Keyword or tag to search for in job listings (e.g., 'python', 'data').
|
| 51 |
+
Leave empty for no keyword filtering.
|
| 52 |
+
limit (int): Number of job results to return, between 1 and 50. Defaults to 20.
|
| 53 |
+
Returns:
|
| 54 |
+
dict: A dictionary with a "jobs" key containing a list of job dictionaries with:
|
| 55 |
+
- title: Job title
|
| 56 |
+
- company: Company name
|
| 57 |
+
- location: Job location
|
| 58 |
+
- url: Application or job posting URL
|
| 59 |
+
- pubDate: Date posted (YYYY-MM-DD)
|
| 60 |
+
- salary: Salary range or 'Not specified'
|
| 61 |
+
|
| 62 |
+
Or an "error" key with an error message if the fetch fails.
|
| 63 |
+
"""
|
| 64 |
base = "https://jobicy.com/api/v2/remote-jobs"
|
| 65 |
params = {"count": max(1, min(limit, 50))}
|
| 66 |
if industry:
|
|
|
|
| 105 |
sorted_jobs = sorted(jobs_raw, key=lambda x: x.get("pubDate", ""), reverse=True)[:params["count"]]
|
| 106 |
return {"jobs": [fmt(j) for j in sorted_jobs]}
|
| 107 |
|
| 108 |
+
def search_jobs_ui(industry, country, keyword, limit):
|
| 109 |
"""
|
| 110 |
Search remote jobs from the Jobicy API with optional filters.
|
| 111 |
|