Skip to content

Commit cbc92d2

Browse files
committed
feat: added search across providers w/o provider input
1 parent 8c83891 commit cbc92d2

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

.github/workflows/ping-server.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Ping / Health Check Paperclip Server
1+
name: Health Check
22

33
on:
44
schedule:

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run Tests
1+
name: Tests
22

33
on:
44
push:

src/server.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,30 @@ async def search_papers(
5757
"error": f"Provider: {provider} not found. Please use list_preprint_providers to get the complete list of all available providers.",
5858
}
5959
if not provider:
60+
all_results = []
61+
62+
arxiv_results = fetch_arxiv_papers(query=query, category=subjects)
63+
all_results.append(arxiv_results)
64+
65+
openalex_results = fetch_openalex_papers(
66+
query=query,
67+
concepts=subjects,
68+
date_published_gte=date_published_gte
69+
)
70+
all_results.append(openalex_results)
71+
72+
osf_results = fetch_osf_preprints(
73+
provider_id="osf",
74+
subjects=subjects,
75+
date_published_gte=date_published_gte,
76+
query=query,
77+
)
78+
all_results.append(osf_results)
79+
6080
return {
61-
"error": "TODO implement search across all providers",
81+
"papers": all_results,
82+
"total_count": len(all_results),
83+
"providers_searched": ["arxiv", "openalex", "osf"],
6284
}
6385
if provider == "osf" or provider in [p["id"] for p in fetch_osf_providers()]:
6486
return fetch_osf_preprints( provider_id=provider,

0 commit comments

Comments
 (0)