academia-mcp 1.2.0__tar.gz → 1.2.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.
Files changed (41) hide show
  1. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/PKG-INFO +1 -1
  2. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp/tools/document_qa.py +7 -3
  3. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp/tools/web_search.py +21 -6
  4. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp.egg-info/PKG-INFO +1 -1
  5. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/pyproject.toml +1 -1
  6. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/LICENSE +0 -0
  7. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/README.md +0 -0
  8. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp/__init__.py +0 -0
  9. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp/__main__.py +0 -0
  10. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp/files.py +0 -0
  11. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp/llm.py +0 -0
  12. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp/py.typed +0 -0
  13. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp/server.py +0 -0
  14. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp/tools/__init__.py +0 -0
  15. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp/tools/anthology_search.py +0 -0
  16. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp/tools/arxiv_download.py +0 -0
  17. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp/tools/arxiv_search.py +0 -0
  18. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp/tools/bitflip.py +0 -0
  19. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp/tools/hf_datasets_search.py +0 -0
  20. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp/tools/md_to_pdf.py +0 -0
  21. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp/tools/py.typed +0 -0
  22. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp/tools/s2_citations.py +0 -0
  23. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp/tools/visit_webpage.py +0 -0
  24. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp/utils.py +0 -0
  25. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp.egg-info/SOURCES.txt +0 -0
  26. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp.egg-info/dependency_links.txt +0 -0
  27. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp.egg-info/entry_points.txt +0 -0
  28. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp.egg-info/requires.txt +0 -0
  29. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/academia_mcp.egg-info/top_level.txt +0 -0
  30. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/setup.cfg +0 -0
  31. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/tests/test_anthology_search.py +0 -0
  32. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/tests/test_arxiv_download.py +0 -0
  33. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/tests/test_arxiv_search.py +0 -0
  34. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/tests/test_bitflip.py +0 -0
  35. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/tests/test_document_qa.py +0 -0
  36. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/tests/test_extract_json.py +0 -0
  37. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/tests/test_hf_dataset_search.py +0 -0
  38. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/tests/test_md_to_pdf.py +0 -0
  39. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/tests/test_s2_citations.py +0 -0
  40. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/tests/test_visit_webpage.py +0 -0
  41. {academia_mcp-1.2.0 → academia_mcp-1.2.2}/tests/test_web_search.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: academia-mcp
3
- Version: 1.2.0
3
+ Version: 1.2.2
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
@@ -1,4 +1,5 @@
1
1
  import os
2
+ import json
2
3
  from typing import List, Any, Dict
3
4
  from dotenv import load_dotenv
4
5
 
@@ -38,7 +39,7 @@ ChatMessages = List[ChatMessage]
38
39
 
39
40
 
40
41
  async def document_qa(
41
- document: str,
42
+ document: str | Dict[str, Any],
42
43
  question: str,
43
44
  ) -> str:
44
45
  """
@@ -55,10 +56,13 @@ async def document_qa(
55
56
  Returns an answer to all questions based on the document content.
56
57
 
57
58
  Args:
58
- question: Question (or questions) to be answered about the document.
59
- document: The full text of the document to analyze.
59
+ question: Question (or questions) to be answered about the document.
60
+ document: The full text of the document to analyze.
60
61
  """
61
62
  assert question and question.strip(), "Please provide non-empty 'question'"
63
+ if isinstance(document, dict):
64
+ document = json.dumps(document)
65
+
62
66
  assert document and document.strip(), "Please provide non-empty 'document'"
63
67
 
64
68
  model_name = os.getenv("DOCUMENT_QA_MODEL_NAME", "deepseek/deepseek-chat-v3-0324")
@@ -28,16 +28,31 @@ def web_search(
28
28
  limit: The maximum number of items to return. 20 by default, maximum 25.
29
29
  provider: The provider to use. "exa", "tavily" or "brave". "tavily" by default.
30
30
  """
31
- assert provider in (
32
- "exa",
33
- "tavily",
34
- "brave",
35
- ), "Error: provider must be either 'exa', 'tavily' or 'brave'"
31
+ providers = ("tavily", "brave", "exa")
32
+ assert provider in providers, "Error: provider must be either 'exa', 'tavily' or 'brave'"
33
+
34
+ is_tavily_available = os.getenv("TAVILY_API_KEY") is not None
35
+ is_exa_available = os.getenv("EXA_API_KEY") is not None
36
+ is_brave_available = os.getenv("BRAVE_API_KEY") is not None
37
+ assert is_tavily_available or is_exa_available or is_brave_available
38
+ availability = {
39
+ "tavily": is_tavily_available,
40
+ "brave": is_brave_available,
41
+ "exa": is_exa_available,
42
+ }
43
+
44
+ if not availability[provider]:
45
+ for p in providers:
46
+ if availability[p]:
47
+ provider = p
48
+ break
36
49
 
37
50
  if provider == "exa":
38
51
  return exa_web_search(query, limit)
39
- if provider == "brave":
52
+ elif provider == "brave":
40
53
  return brave_web_search(query, limit)
54
+
55
+ assert provider == "tavily"
41
56
  return tavily_web_search(query, limit)
42
57
 
43
58
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: academia-mcp
3
- Version: 1.2.0
3
+ Version: 1.2.2
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "academia-mcp"
7
- version = "1.2.0"
7
+ version = "1.2.2"
8
8
  description = "MCP server that provides different tools to search for scientific publications"
9
9
  readme = "README.md"
10
10
  authors = [
File without changes
File without changes
File without changes