builtsimple-research 1.0.1__tar.gz → 1.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {builtsimple_research-1.0.1 → builtsimple_research-1.0.2}/PKG-INFO +1 -1
- {builtsimple_research-1.0.1 → builtsimple_research-1.0.2}/builtsimple_research/__init__.py +8 -7
- {builtsimple_research-1.0.1 → builtsimple_research-1.0.2}/pyproject.toml +1 -1
- {builtsimple_research-1.0.1 → builtsimple_research-1.0.2}/README.md +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: builtsimple-research
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.2
|
|
4
4
|
Summary: Unified API for PubMed, ArXiv, and Wikipedia semantic search
|
|
5
5
|
Project-URL: Homepage, https://built-simple.ai
|
|
6
6
|
Project-URL: Repository, https://github.com/Built-Simple/python-builtsimple
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import httpx
|
|
3
3
|
from typing import List, Optional, Dict, Any
|
|
4
4
|
|
|
5
|
-
__version__ = "1.0.
|
|
5
|
+
__version__ = "1.0.2"
|
|
6
6
|
|
|
7
7
|
BASE_URLS = {
|
|
8
8
|
"pubmed": "https://pubmed.built-simple.ai",
|
|
@@ -31,10 +31,10 @@ async def search_arxiv(query: str, limit: int = 10) -> List[Dict[str, Any]]:
|
|
|
31
31
|
return [{"source": "ArXiv", **r} for r in data.get("results", [])]
|
|
32
32
|
|
|
33
33
|
async def search_wikipedia(query: str, limit: int = 10) -> List[Dict[str, Any]]:
|
|
34
|
-
"""Search Wikipedia articles."""
|
|
35
|
-
async with httpx.AsyncClient() as client:
|
|
34
|
+
"""Search Wikipedia articles with hybrid search (vector + BM25)."""
|
|
35
|
+
async with httpx.AsyncClient(timeout=60.0) as client:
|
|
36
36
|
response = await client.post(
|
|
37
|
-
f"{BASE_URLS['wikipedia']}/api/
|
|
37
|
+
f"{BASE_URLS['wikipedia']}/api/hybrid",
|
|
38
38
|
json={"query": query, "limit": limit}
|
|
39
39
|
)
|
|
40
40
|
data = response.json()
|
|
@@ -69,9 +69,10 @@ def search_arxiv_sync(query: str, limit: int = 10) -> List[Dict[str, Any]]:
|
|
|
69
69
|
return [{"source": "ArXiv", **r} for r in response.json().get("results", [])]
|
|
70
70
|
|
|
71
71
|
def search_wikipedia_sync(query: str, limit: int = 10) -> List[Dict[str, Any]]:
|
|
72
|
-
"""Synchronous Wikipedia search."""
|
|
72
|
+
"""Synchronous Wikipedia search with hybrid (vector + BM25)."""
|
|
73
73
|
response = httpx.post(
|
|
74
|
-
f"{BASE_URLS['wikipedia']}/api/
|
|
75
|
-
json={"query": query, "limit": limit}
|
|
74
|
+
f"{BASE_URLS['wikipedia']}/api/hybrid",
|
|
75
|
+
json={"query": query, "limit": limit},
|
|
76
|
+
timeout=60.0
|
|
76
77
|
)
|
|
77
78
|
return [{"source": "Wikipedia", **r} for r in response.json().get("results", [])]
|
|
File without changes
|