OppaAI commited on
Commit
8f4df5d
·
verified ·
1 Parent(s): 48a6e57

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -16,7 +16,7 @@ def search_jobs_tool(query: str = "", location: str = "", limit: int = 10) -> di
16
 
17
  if query.strip():
18
  params["tag"] = query.strip()
19
- if location.strip():
20
  params["geo"] = location.strip().lower()
21
 
22
  headers = {
@@ -90,7 +90,6 @@ def search_jobs_ui(query="", location="", limit=10):
90
 
91
  output = "# Jobicy Remote Job Search Results\n\n"
92
  for i, job in enumerate(jobs, 1):
93
- # 只保留日期部分 YYYY-MM-DD
94
  try:
95
  posted_date = job['pubDate'][:10]
96
  except Exception:
@@ -108,14 +107,14 @@ def search_jobs_ui(query="", location="", limit=10):
108
  return output
109
 
110
  country_choices = [
111
- "", "canada", "united states", "united kingdom", "australia", "germany", "france", "india"
112
  ]
113
 
114
  app = gr.Interface(
115
  fn=search_jobs_ui,
116
  inputs=[
117
  gr.Textbox(label="Job Title / Keyword (optional)", placeholder="e.g., Software Engineer"),
118
- gr.Dropdown(label="Country (optional)", choices=country_choices, value="", interactive=True),
119
  gr.Slider(minimum=1, maximum=50, value=10, step=1, label="Number of Results"),
120
  ],
121
  outputs=gr.Markdown(),
 
16
 
17
  if query.strip():
18
  params["tag"] = query.strip()
19
+ if location.strip() and location.strip().lower() != "anywhere":
20
  params["geo"] = location.strip().lower()
21
 
22
  headers = {
 
90
 
91
  output = "# Jobicy Remote Job Search Results\n\n"
92
  for i, job in enumerate(jobs, 1):
 
93
  try:
94
  posted_date = job['pubDate'][:10]
95
  except Exception:
 
107
  return output
108
 
109
  country_choices = [
110
+ "Anywhere", "canada", "united states", "united kingdom", "australia", "germany", "france", "india"
111
  ]
112
 
113
  app = gr.Interface(
114
  fn=search_jobs_ui,
115
  inputs=[
116
  gr.Textbox(label="Job Title / Keyword (optional)", placeholder="e.g., Software Engineer"),
117
+ gr.Dropdown(label="Country (optional)", choices=country_choices, value="Anywhere", interactive=True),
118
  gr.Slider(minimum=1, maximum=50, value=10, step=1, label="Number of Results"),
119
  ],
120
  outputs=gr.Markdown(),