Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add EmbeddingModelComponent for generating embeddings #7204

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rodrigosnader
Copy link
Contributor

  • Introduced a new EmbeddingModelComponent to generate embeddings using specified providers, starting with OpenAI.
  • Updated the init.py file to include the new component in the exports.
  • The component includes various input fields for configuration, such as provider selection, model name, API key, and additional parameters.

- Introduced a new EmbeddingModelComponent to generate embeddings using specified providers, starting with OpenAI.
- Updated the __init__.py file to include the new component in the exports.
- The component includes various input fields for configuration, such as provider selection, model name, API key, and additional parameters.
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Mar 21, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 21, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

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 a new EmbeddingModelComponent for generating embeddings using OpenAI and updates the component exports to include the new model component.

  • Introduces the EmbeddingModelComponent with multiple configuration inputs for provider, model, API key, and other parameters.
  • Updates the init.py file to export the new component.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/backend/base/langflow/components/embeddings/embedding_model.py Adds the new component definition and implementation for generating embeddings.
src/backend/base/langflow/components/embeddings/init.py Updates the exports to include the new EmbeddingModelComponent.
Comments suppressed due to low confidence (2)

src/backend/base/langflow/components/embeddings/embedding_model.py:24

  • [nitpick] The component class is named 'EmbeddingModelComponent' but its 'name' attribute is set to 'EmbeddingModel'; consider aligning these names for consistency.
name = "EmbeddingModel"

src/backend/base/langflow/components/embeddings/embedding_model.py:103

  • [nitpick] Consider providing a more descriptive error message that outlines the supported provider(s) when an unknown provider is encountered.
msg = f"Unknown provider: {provider}"

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants