academia-mcp 1.10.6__py3-none-any.whl → 1.10.7__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.
- academia_mcp/tools/web_search.py +26 -1
- {academia_mcp-1.10.6.dist-info → academia_mcp-1.10.7.dist-info}/METADATA +1 -1
- {academia_mcp-1.10.6.dist-info → academia_mcp-1.10.7.dist-info}/RECORD +7 -7
- {academia_mcp-1.10.6.dist-info → academia_mcp-1.10.7.dist-info}/WHEEL +0 -0
- {academia_mcp-1.10.6.dist-info → academia_mcp-1.10.7.dist-info}/entry_points.txt +0 -0
- {academia_mcp-1.10.6.dist-info → academia_mcp-1.10.7.dist-info}/licenses/LICENSE +0 -0
- {academia_mcp-1.10.6.dist-info → academia_mcp-1.10.7.dist-info}/top_level.txt +0 -0
academia_mcp/tools/web_search.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import json
|
2
|
-
from typing import Optional, List
|
2
|
+
from typing import Optional, List, Tuple
|
3
3
|
|
4
4
|
from academia_mcp.utils import post_with_retries, get_with_retries
|
5
5
|
from academia_mcp.settings import settings
|
@@ -12,6 +12,24 @@ BRAVE_SEARCH_URL = "https://api.search.brave.com/res/v1/web/search"
|
|
12
12
|
EXCLUDE_DOMAINS = ["chatpaper.com"]
|
13
13
|
|
14
14
|
|
15
|
+
def _parse_domains(query: str) -> Tuple[str, List[str]]:
|
16
|
+
site_term = "site:"
|
17
|
+
if site_term not in query:
|
18
|
+
return query, []
|
19
|
+
parts = query.split()
|
20
|
+
query_parts = []
|
21
|
+
include_domains = []
|
22
|
+
for part in parts:
|
23
|
+
if not part.startswith(site_term):
|
24
|
+
query_parts.append(part)
|
25
|
+
continue
|
26
|
+
domain = part[len(site_term) :]
|
27
|
+
if domain:
|
28
|
+
include_domains.append(domain)
|
29
|
+
query = " ".join(query_parts)
|
30
|
+
return query, include_domains
|
31
|
+
|
32
|
+
|
15
33
|
def web_search(
|
16
34
|
query: str,
|
17
35
|
limit: Optional[int] = 20,
|
@@ -40,6 +58,13 @@ def web_search(
|
|
40
58
|
isinstance(domain, str) for domain in include_domains
|
41
59
|
), "Error: include_domains should be a list of strings"
|
42
60
|
|
61
|
+
query, query_include_domains = _parse_domains(query)
|
62
|
+
if query_include_domains:
|
63
|
+
if include_domains:
|
64
|
+
include_domains.extend(query_include_domains)
|
65
|
+
else:
|
66
|
+
include_domains = query_include_domains
|
67
|
+
|
43
68
|
is_tavily_available = bool(settings.TAVILY_API_KEY)
|
44
69
|
is_exa_available = bool(settings.EXA_API_KEY)
|
45
70
|
is_brave_available = bool(settings.BRAVE_API_KEY)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: academia-mcp
|
3
|
-
Version: 1.10.
|
3
|
+
Version: 1.10.7
|
4
4
|
Summary: MCP server that provides different tools to search for scientific publications
|
5
5
|
Author-email: Ilya Gusev <phoenixilya@gmail.com>
|
6
6
|
Project-URL: Homepage, https://github.com/IlyaGusev/academia_mcp
|
@@ -23,10 +23,10 @@ academia_mcp/tools/s2.py,sha256=QX7-pbetab3Xt_1tvVPU6o5D_NAe9y6jcTGRBK1vwtY,6200
|
|
23
23
|
academia_mcp/tools/show_image.py,sha256=jiJlQ53dbZ0T61OBhCT3IKVvBl9NHc6jHgWLfg5BxiE,3856
|
24
24
|
academia_mcp/tools/speech_to_text.py,sha256=YZzMqdvunzXkpcadP_mYhm6cs4qH1Y_42SfY-7eX4O4,1601
|
25
25
|
academia_mcp/tools/visit_webpage.py,sha256=swlFwWRzWc7-AHP2ouRZJScSTA4dHZ32fuJnA2V0lUc,3311
|
26
|
-
academia_mcp/tools/web_search.py,sha256=
|
27
|
-
academia_mcp-1.10.
|
28
|
-
academia_mcp-1.10.
|
29
|
-
academia_mcp-1.10.
|
30
|
-
academia_mcp-1.10.
|
31
|
-
academia_mcp-1.10.
|
32
|
-
academia_mcp-1.10.
|
26
|
+
academia_mcp/tools/web_search.py,sha256=VphVztf2jZNT3bPJPJuTdMkKbe2-LIbSV7keKV47lac,8616
|
27
|
+
academia_mcp-1.10.7.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
28
|
+
academia_mcp-1.10.7.dist-info/METADATA,sha256=MwRwYr89KMWr7wU2ntf45UbAcmGqxQe8beCwXwKIkjk,6311
|
29
|
+
academia_mcp-1.10.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
30
|
+
academia_mcp-1.10.7.dist-info/entry_points.txt,sha256=gxkiKJ74w2FwJpSECpjA3XtCfI5ZfrM6N8cqnwsq4yY,51
|
31
|
+
academia_mcp-1.10.7.dist-info/top_level.txt,sha256=CzGpRFsRRJRqWEb1e3SUlcfGqRzOxevZGaJWrtGF8W0,13
|
32
|
+
academia_mcp-1.10.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|