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

refactor(python-sdk): Improve request handling, pagination, and error handling #1165

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

colesmcintosh
Copy link

This pull request introduces a series of methodical improvements to the Firecrawl Python SDK, aimed at fortifying its resilience and clarity. Key enhancements include:

  • Generic Response Classes: Implementation of generic response data and crawl status classes, which encapsulate response details and streamline data management across the SDK.
  • Robust Retry Mechanism: Introduction of an exponential backoff strategy for request retries, significantly improving the SDK’s ability to gracefully handle transient failures.
  • Refined Pagination: Enhanced pagination handling for crawl status requests, ensuring efficient and reliable traversal through paginated data sets.
  • Simplified Error Handling: Consolidation of error management and response parsing logic, reducing complexity while improving maintainability.
  • Type Hints and Structural Improvements: Addition of comprehensive type hints alongside structural refinements, enhancing code clarity and facilitating future development.

These modifications collectively enhance the robustness, readability, and overall maintainability of the Firecrawl SDK, ensuring a more seamless developer experience.

…crawl SDK

- Add generic response data and crawl status classes
- Implement robust request retry mechanism with exponential backoff
- Enhance pagination handling for crawl status requests
- Simplify error handling and response parsing
- Add type hints and improve code structure
@fumeoss
Copy link

fumeoss commented Feb 20, 2025

Summary

  • Introduces generic response classes for better encapsulation of API response data.
  • Implements a robust retry mechanism using exponential backoff for request failures.
  • Enhances pagination handling for crawl status requests improving data retrieval.
  • Simplifies error handling and response parsing, making the codebase cleaner and more maintainable.
  • Adds type hints and structural improvements to increase code clarity and facilitate future development.
🚨 1 passed, 1 failed

🟢 Automated Test: Verify Generic Response Container Error Handling

🔴 Test Exponential Backoff Retry Logic for FirecrawlApp

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.

2 participants