Fixed, now is output_type = 'dict'
Browse files
tools/linkedin_job_search.py
CHANGED
@@ -12,9 +12,9 @@ class LinkedInJobSearchTool(Tool):
|
|
12 |
"work_mode": {"type": "string", "description": "remote, hybrid, in-office"}
|
13 |
}
|
14 |
|
15 |
-
output_type = "
|
16 |
|
17 |
-
def forward(self, position: str, location: str, work_mode: str) ->
|
18 |
"""
|
19 |
Searches LinkedIn for job postings using SerpAPI.
|
20 |
"""
|
@@ -35,7 +35,7 @@ class LinkedInJobSearchTool(Tool):
|
|
35 |
data = response.json()
|
36 |
job_results = data.get("jobs_results", [])
|
37 |
|
38 |
-
|
39 |
{
|
40 |
"title": job["title"],
|
41 |
"company": job.get("company_name", "N/A"),
|
@@ -45,5 +45,8 @@ class LinkedInJobSearchTool(Tool):
|
|
45 |
}
|
46 |
for job in job_results
|
47 |
]
|
|
|
|
|
|
|
48 |
else:
|
49 |
-
return
|
|
|
12 |
"work_mode": {"type": "string", "description": "remote, hybrid, in-office"}
|
13 |
}
|
14 |
|
15 |
+
output_type = "dict" # ✅ Use "dict" instead of "list[dict]"
|
16 |
|
17 |
+
def forward(self, position: str, location: str, work_mode: str) -> Dict:
|
18 |
"""
|
19 |
Searches LinkedIn for job postings using SerpAPI.
|
20 |
"""
|
|
|
35 |
data = response.json()
|
36 |
job_results = data.get("jobs_results", [])
|
37 |
|
38 |
+
formatted_jobs = [
|
39 |
{
|
40 |
"title": job["title"],
|
41 |
"company": job.get("company_name", "N/A"),
|
|
|
45 |
}
|
46 |
for job in job_results
|
47 |
]
|
48 |
+
|
49 |
+
return {"jobs": formatted_jobs} # ✅ Wrap list inside a dictionary
|
50 |
+
|
51 |
else:
|
52 |
+
return {"error": f"Error {response.status_code}: {response.text}"}
|