builtsimple-research 1.0.0__py2.py3-none-any.whl → 1.0.2__py2.py3-none-any.whl

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.
@@ -2,7 +2,7 @@
2
2
  import httpx
3
3
  from typing import List, Optional, Dict, Any
4
4
 
5
- __version__ = "1.0.0"
5
+ __version__ = "1.0.2"
6
6
 
7
7
  BASE_URLS = {
8
8
  "pubmed": "https://pubmed.built-simple.ai",
@@ -12,9 +12,9 @@ BASE_URLS = {
12
12
 
13
13
  async def search_pubmed(query: str, limit: int = 10) -> List[Dict[str, Any]]:
14
14
  """Search PubMed biomedical literature."""
15
- async with httpx.AsyncClient() as client:
15
+ async with httpx.AsyncClient(timeout=60.0) as client:
16
16
  response = await client.post(
17
- f"{BASE_URLS['pubmed']}/search",
17
+ f"{BASE_URLS['pubmed']}/hybrid-search",
18
18
  json={"query": query, "limit": limit}
19
19
  )
20
20
  data = response.json()
@@ -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/search",
37
+ f"{BASE_URLS['wikipedia']}/api/hybrid",
38
38
  json={"query": query, "limit": limit}
39
39
  )
40
40
  data = response.json()
@@ -54,8 +54,9 @@ async def search_all(query: str, limit: int = 10) -> List[Dict[str, Any]]:
54
54
  def search_pubmed_sync(query: str, limit: int = 10) -> List[Dict[str, Any]]:
55
55
  """Synchronous PubMed search."""
56
56
  response = httpx.post(
57
- f"{BASE_URLS['pubmed']}/search",
58
- json={"query": query, "limit": limit}
57
+ f"{BASE_URLS['pubmed']}/hybrid-search",
58
+ json={"query": query, "limit": limit},
59
+ timeout=60.0
59
60
  )
60
61
  return [{"source": "PubMed", **r} for r in response.json().get("results", [])]
61
62
 
@@ -68,9 +69,10 @@ def search_arxiv_sync(query: str, limit: int = 10) -> List[Dict[str, Any]]:
68
69
  return [{"source": "ArXiv", **r} for r in response.json().get("results", [])]
69
70
 
70
71
  def search_wikipedia_sync(query: str, limit: int = 10) -> List[Dict[str, Any]]:
71
- """Synchronous Wikipedia search."""
72
+ """Synchronous Wikipedia search with hybrid (vector + BM25)."""
72
73
  response = httpx.post(
73
- f"{BASE_URLS['wikipedia']}/api/search",
74
- json={"query": query, "limit": limit}
74
+ f"{BASE_URLS['wikipedia']}/api/hybrid",
75
+ json={"query": query, "limit": limit},
76
+ timeout=60.0
75
77
  )
76
78
  return [{"source": "Wikipedia", **r} for r in response.json().get("results", [])]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: builtsimple-research
3
- Version: 1.0.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
@@ -0,0 +1,4 @@
1
+ builtsimple_research/__init__.py,sha256=LXMvpX-y6-PkPiH9VNxCBCgWurg9P3e6Ll1CVeLSNFs,3068
2
+ builtsimple_research-1.0.2.dist-info/METADATA,sha256=010mP2OscR23yePKbohmYZ6o-oNEJtGBLGSKG3Wg4IE,1740
3
+ builtsimple_research-1.0.2.dist-info/WHEEL,sha256=aha0VrrYvgDJ3Xxl3db_g_MDIW-ZexDdrc_m-Hk8YY4,105
4
+ builtsimple_research-1.0.2.dist-info/RECORD,,
@@ -1,4 +0,0 @@
1
- builtsimple_research/__init__.py,sha256=XMWHQYSaZkJ1opFgaxsfZ16ZQp0N1xH9Qu_yj0LR_Eo,2923
2
- builtsimple_research-1.0.0.dist-info/METADATA,sha256=70StI2bfRhlr8kXOQb8iNzYjriaQ-IoKzlzdyxZ6IpY,1740
3
- builtsimple_research-1.0.0.dist-info/WHEEL,sha256=aha0VrrYvgDJ3Xxl3db_g_MDIW-ZexDdrc_m-Hk8YY4,105
4
- builtsimple_research-1.0.0.dist-info/RECORD,,