Files
crewAI/lib/crewai-tools/tests
Devin AI 62d12543f2 Fix RagTool validation and qdrant import issues (#3918)
- Fix issue #3: Make similarity_threshold and limit optional with defaults
  - Updated BaseTool._default_args_schema to extract default values from function signatures
  - Updated BaseTool._set_args_schema for consistency
  - Now uses inspect.signature() and pydantic.create_model() to properly handle defaults

- Fix issue #1: Make qdrant_client import conditional
  - Moved qdrant_client imports to TYPE_CHECKING block
  - Added runtime imports only when QdrantConfig is actually used
  - Prevents import errors when using ChromaDB without qdrant_client installed

- Added comprehensive tests:
  - test_rag_tool_default_parameters_are_optional: Verifies schema has correct required fields
  - test_rag_tool_chromadb_no_qdrant_import: Ensures ChromaDB usage doesn't import qdrant_client

All existing tests pass. Fixes reported issues where LLM calls would fail with ValidationError
on first attempt due to required fields that should have been optional.

Co-Authored-By: João <joao@crewai.com>
2025-11-14 15:09:34 +00:00
..
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00