feat(tools): add WikipediaSearchTool#5835
Conversation
📝 WalkthroughWalkthroughAdds a new WikipediaSearchTool that wraps the optional ChangesWikipediaSearchTool Implementation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@lib/crewai-tools/src/crewai_tools/tools/wikipedia_search_tool/wikipedia_search_tool.py`:
- Around line 20-22: The Field for "sentences" currently allows zero or negative
values; update the schema on the model that defines sentences (the sentences:
int = Field(...)) to enforce a lower bound (e.g., set ge=1 or add a Pydantic
validator on the same model/class) so inputs <1 are rejected at validation time;
locate the sentences Field in the wikipedia_search_tool model and add the
appropriate constraint (ge=1) or a validator to raise a ValidationError for
values <1.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: fabdd6d5-0006-4376-b93c-7a33616bdf94
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (6)
lib/crewai-tools/pyproject.tomllib/crewai-tools/src/crewai_tools/__init__.pylib/crewai-tools/src/crewai_tools/tools/__init__.pylib/crewai-tools/src/crewai_tools/tools/wikipedia_search_tool/__init__.pylib/crewai-tools/src/crewai_tools/tools/wikipedia_search_tool/wikipedia_search_tool.pylib/crewai-tools/tests/tools/test_wikipedia_search_tool.py
Closes #5823
Summary
Adds a new
WikipediaSearchTooltocrewai-toolsfor topic-based Wikipedia lookup with concise summaries.What Changed
WikipediaSearchToolwikipediadependency and updated lockfileTesting
Ran:
uv run pytest lib/crewai-tools/tests/tools/test_wikipedia_search_tool.pyuv run ruff check lib/crewai-tools/src/crewai_tools/tools/wikipedia_search_tool lib/crewai-tools/tests/tools/test_wikipedia_search_tool.py lib/crewai-tools/src/crewai_tools/__init__.py lib/crewai-tools/src/crewai_tools/tools/__init__.pyNotes
The tool uses the
wikipediaPython package and handles it as an optional dependency.Summary by CodeRabbit