Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add arxiv tool. resolves #252 #301

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zhjuzi
Copy link

@zhjuzi zhjuzi commented Feb 16, 2025

feat: Add ArxivTool for Academic Paper Search and Retrieval

Description

Added a new ArxivTool that enables searching and retrieving academic papers from arXiv. This tool enhances the system's ability to access and process academic research papers, supporting both search by keywords and full paper text retrieval.

Features

  1. ArxivTool Implementation (arxiv_tool.py):

    • Paper search functionality with keyword support
    • Full paper text retrieval using paper ID
    • Smart query processing with length limitation
    • Comprehensive paper metadata extraction (title, authors, date, summary)
    • Retry mechanism for handling network issues
    • Clean error handling and informative error messages
    • c7a23b24869228871eac023dbbd11e8
    • cc285b08f764d4cd33e4dad56b490f9
  2. Test Implementation (test_arxiv_tool.py):

    • Unit tests for paper search functionality
    • Unit tests for paper detail retrieval
    • Unit tests for invalid mode handling
    • Integration tests with actual arXiv API
  3. Utility Implementation (utils/retry.py):

    • Generic retry decorator for handling transient failures
    • Configurable retry count and delay
    • Detailed error reporting with retry attempts

Technical Details

  • Built on top of the base Tool class
  • Uses arxiv library for API interaction
  • Uses pypdf for PDF text extraction
  • Implements retry mechanism for network resilience
  • Configurable search parameters (results count, sort criteria)

Test Results

  • All unit tests pass successfully
  • Test coverage for all main functionalities
  • Real API integration tested and working
  • 83b9d348a14c7cda3b6d82bcc046d22

Dependencies

  • arxiv
  • pypdf
  • pydantic

Related Issue

Implements #issue252

Checklist

  • [√] Read and understood the Contributor Guidelines
  • [√] Code follows project's coding style (PEP8 and Google Python Style)
  • [√] Added comprehensive test cases
  • [√] All tests pass
  • [√] Added necessary documentation
  • [√] Added type hints and docstrings
  • [√] Implemented retry mechanism for network resilience
  • [√] Proper error handling and user feedback

@zhjuzi zhjuzi changed the title feat: arxiv tool feat: arxiv tool. resolves #252 Feb 16, 2025
@zhjuzi zhjuzi changed the title feat: arxiv tool. resolves #252 feat: add arxiv tool. resolves #252 Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant