docs(rag): add xpu to embedding device options - #6808
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe change documents ChangesEmbedding device support
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR updates the RAG embeddings documentation and provider metadata to explicitly include Intel xpu as a supported/commonly used device string for the Instructor and Sentence Transformer embedding providers, and extends a backward-compatibility test to ensure documented device values are preserved in configuration.
Changes:
- Document
xpuas a device option for Instructor and Sentence Transformer inragtool.mdx(EN + AR). - Update Pydantic field descriptions for
devicein the Instructor and Sentence Transformer providers to includempsandxpu. - Parameterize the Sentence Transformer config test to validate that documented device strings are preserved.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| lib/crewai/tests/rag/embeddings/test_backward_compatibility.py | Parameterizes the Sentence Transformer config test over device strings. |
| lib/crewai/src/crewai/rag/embeddings/providers/sentence_transformer/sentence_transformer_provider.py | Expands device field description to include mps/xpu. |
| lib/crewai/src/crewai/rag/embeddings/providers/instructor/instructor_provider.py | Expands device field description to include mps/xpu. |
| docs/edge/en/tools/ai-ml/ragtool.mdx | Adds xpu to documented device options for Instructor and Sentence Transformer. |
| docs/edge/ar/tools/ai-ml/ragtool.mdx | Mirrors the English doc update by adding xpu to the Arabic device options lists. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| def test_ragtool_sentence_transformer_config(self): | ||
| """Test RagTool SentenceTransformer config from ragtool.mdx.""" | ||
| @pytest.mark.parametrize("device", ["cuda", "mps", "xpu"]) |
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/tests/rag/embeddings/test_backward_compatibility.py`:
- Around line 342-347: Update the device parameterization in
test_ragtool_sentence_transformer_config to include the documented cpu value
alongside cuda, mps, and xpu, preserving the docstring’s claim that all
documented device strings are covered.
🪄 Autofix
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: e88b0346-bf6f-4f1e-b8a6-22e705daeaca
📒 Files selected for processing (5)
docs/edge/ar/tools/ai-ml/ragtool.mdxdocs/edge/en/tools/ai-ml/ragtool.mdxlib/crewai/src/crewai/rag/embeddings/providers/instructor/instructor_provider.pylib/crewai/src/crewai/rag/embeddings/providers/sentence_transformer/sentence_transformer_provider.pylib/crewai/tests/rag/embeddings/test_backward_compatibility.py
Summary
Add
xputo the documented device options for the Instructor and Sentence Transformer embedding providers.Changes
xputo the RagTool configuration documentationcpu,cuda,mps, andxpuMotivation
The providers pass the configured device string to their underlying embedding implementations, but their documentation and field descriptions did not mention Intel XPU as an available option. This update makes the documented options more complete and consistent.
Testing
Ran unit tests and code quality checks and all passed.
uv run pytest lib/crewai/tests/ -x -q->4588 passeduv run mypy lib/->Success: no issues found in 895 source files