feat(embedding): embedding component impl#45
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…xample.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive embedding functionality to QuantMind through a new EmbeddingBlock class, providing a unified interface for generating text embeddings across multiple providers (OpenAI, Azure, Cohere) using LiteLLM.
- Introduces
EmbeddingBlockclass with support for single and batch embedding generation - Adds
EmbeddingConfigfor flexible configuration management with provider auto-detection - Implements comprehensive error handling, retry logic, and connection testing
- Provides extensive documentation and examples for different use cases
Reviewed Changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| wiki/embedding.md | Comprehensive user documentation with examples and best practices |
| tests/llm/test_embedding_block.py | Complete test suite for EmbeddingBlock functionality |
| tests/config/test_embedding.py | Tests for EmbeddingConfig validation and methods |
| quantmind/llm/embedding.py | Core EmbeddingBlock implementation with retry logic and batch processing |
| quantmind/llm/init.py | Exports for new embedding classes |
| quantmind/config/embedding.py | Configuration class with provider detection and parameter validation |
| quantmind/config/init.py | Adds EmbeddingConfig to module exports |
| examples/llm/embedding_block_example.py | Practical examples showing different provider configurations |
| docs/EMBEDDINGS.md | API reference documentation |
| README.md | Updates overview section with expanded description |
|
@bridgeqiqi You did very well, there are still some small details that need to be discussed, refer to my comments. |
@keli-wen Thanks for your review and nice comments. I've pushed new updates. Please feel free to review it again. |
keli-wen
left a comment
There was a problem hiding this comment.
I think it's actually enough now, but let's do better.
keli-wen
left a comment
There was a problem hiding this comment.
LGTM, thanks @bridgeqiqi
Description
Refer to #33
Checklist
Please feel free to remove inapplicable items for your PR.