Skip to content

feat(embedding): embedding component impl#45

Merged
keli-wen merged 19 commits into
masterfrom
u/jiaqi/test
Aug 3, 2025
Merged

feat(embedding): embedding component impl#45
keli-wen merged 19 commits into
masterfrom
u/jiaqi/test

Conversation

@bridgeqiqi

@bridgeqiqi bridgeqiqi commented Jul 31, 2025

Copy link
Copy Markdown
Contributor

Description

Refer to #33

Checklist

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [$CATEGORY] (such as [Docs], [Fix], [Feature], [Refactor])
  • Related issue is referred in this PR
  • The markdown and latex are rendered correctly.
  • The code in PR is well-documented.
  • The PR is complete and small, read the Google eng practice (CL equals to PR) to understand more about small PR.

@bridgeqiqi bridgeqiqi self-assigned this Jul 31, 2025
@bridgeqiqi bridgeqiqi requested review from Copilot and keli-wen August 1, 2025 19:12

This comment was marked as outdated.

@bridgeqiqi bridgeqiqi requested a review from Copilot August 2, 2025 04:27

This comment was marked as outdated.

bridgeqiqi and others added 6 commits August 2, 2025 12:33
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>
@bridgeqiqi bridgeqiqi requested a review from Copilot August 2, 2025 04:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 EmbeddingBlock class with support for single and batch embedding generation
  • Adds EmbeddingConfig for 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

@LLMQuant LLMQuant deleted a comment from Copilot AI Aug 2, 2025
@LLMQuant LLMQuant deleted a comment from Copilot AI Aug 2, 2025
@LLMQuant LLMQuant deleted a comment from Copilot AI Aug 2, 2025
@LLMQuant LLMQuant deleted a comment from Copilot AI Aug 2, 2025
@LLMQuant LLMQuant deleted a comment from Copilot AI Aug 2, 2025
@LLMQuant LLMQuant deleted a comment from Copilot AI Aug 2, 2025
@LLMQuant LLMQuant deleted a comment from Copilot AI Aug 2, 2025
@bridgeqiqi bridgeqiqi added the good first issue Good for newcomers label Aug 2, 2025
@bridgeqiqi bridgeqiqi added the help wanted Extra attention is needed label Aug 2, 2025
@bridgeqiqi bridgeqiqi linked an issue Aug 2, 2025 that may be closed by this pull request
4 tasks
Comment thread quantmind/config/embedding.py Outdated
Comment thread quantmind/llm/embedding.py Outdated
Comment thread quantmind/llm/embedding.py Outdated
Comment thread quantmind/llm/embedding.py
Comment thread wiki/embedding.md
@keli-wen

keli-wen commented Aug 2, 2025

Copy link
Copy Markdown
Contributor

@bridgeqiqi You did very well, there are still some small details that need to be discussed, refer to my comments.

@keli-wen keli-wen changed the title [Feature] Add embedding feat(embedding): embedding component impl Aug 2, 2025
@bridgeqiqi bridgeqiqi requested a review from keli-wen August 2, 2025 15:41
@bridgeqiqi

Copy link
Copy Markdown
Contributor Author

@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 keli-wen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's actually enough now, but let's do better.

Comment thread examples/llm/embedding_block_example.py Outdated
Comment thread quantmind/config/embedding.py
Comment thread quantmind/config/embedding.py
Comment thread quantmind/llm/embedding.py Outdated
Comment thread quantmind/llm/embedding.py
@bridgeqiqi bridgeqiqi requested a review from keli-wen August 3, 2025 05:04

@keli-wen keli-wen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @bridgeqiqi

Comment thread quantmind/config/embedding.py
Comment thread quantmind/config/embedding.py
Comment thread quantmind/llm/embedding.py
@keli-wen keli-wen merged commit 3adae85 into master Aug 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good first issue Good for newcomers help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feautre] Add the embedding integration.

5 participants