Skip to content

Conversation

@Ahmed-Tawfik94
Copy link
Collaborator

Summary

Fixes #678 - Replace deprecated class-based Config with ConfigDict for Pydantic v2 compatibility. This eliminates deprecation warnings when importing Crawl4AI models.

List of files changed and why

  • models.py - Updated Pydantic model configurations from deprecated class-based Config to modern ConfigDict syntax in CrawlResult and AsyncCrawlResponse classes. Added ConfigDict to imports.

How Has This Been Tested?

  • Verified that importing crawl4ai.models with deprecation warnings enabled (python -W default::DeprecationWarning -c "import crawl4ai.models") produces no warnings after the fix
  • Confirmed the module imports successfully without errors
  • Reproduced the original issue by temporarily reverting changes, which triggered the expected deprecation warnings for both affected classes

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas (no new comments needed, changes are straightforward)
  • I have made corresponding changes to the documentation (not applicable for this config syntax update)
  • I have added/updated unit tests that prove my fix is effective or that my feature works (existing tests should continue to pass)
  • New and existing unit tests pass locally with my changes (verified import works correctly)

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.

3 participants