Skip to content

fix: Improve appearance of IBM watsonX im Embedding Model component#10469

Merged
edwinjosechittilappilly merged 11 commits into
mainfrom
fix-embed-model-watson
Nov 2, 2025
Merged

fix: Improve appearance of IBM watsonX im Embedding Model component#10469
edwinjosechittilappilly merged 11 commits into
mainfrom
fix-embed-model-watson

Conversation

@erichare
Copy link
Copy Markdown
Collaborator

@erichare erichare commented Oct 31, 2025

This pull request updates the embedding model provider references from "WatsonX" to "IBM watsonx.ai" across both the starter project configuration and the main embedding model component. The changes improve clarity and consistency in naming, update user-facing descriptions, and adjust configuration logic to match the new provider name.

Provider naming and user interface updates:

  • Changed all references of "WatsonX" to "IBM watsonx.ai" in both the provider options and user-facing info strings in EmbeddingModelComponent and the starter project config (Nvidia Remix.json). This includes dropdown options, help texts, and error messages. [1] [2] [3] [4]

Embedding logic and error handling:

  • Updated the logic in build_embeddings to check for "IBM watsonx.ai" as the provider, and revised error messages to reference the new provider name for better clarity.

Configuration logic improvements:

  • Adjusted the update_build_config method to handle the new provider name, set appropriate display names, and toggle the advanced flag for API base URLs to match provider requirements. [1] [2]

Starter project code hash update:

  • Updated the code_hash in Nvidia Remix.json to reflect changes in the code logic and configuration.

Summary by CodeRabbit

  • Chores
    • Updated the embedding provider selector to display the official product name "IBM watsonx.ai" instead of "WatsonX".
    • Refreshed configuration fields, validation messages, and error handling to consistently reflect IBM-specific terminology throughout the embedding provider configuration flow.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Oct 31, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The PR updates the embedding model component to rename the WatsonX provider to "IBM watsonx.ai" and adjusts related provider handling logic, including updated validation messages, configuration field naming, and conditional logic for different provider types.

Changes

Cohort / File(s) Summary
Provider naming and configuration updates
src/lfx/src/lfx/components/models/embedding_model.py
Provider option changed from "WatsonX" to "IBM watsonx.ai"; WatsonX-specific textual references updated across validation messages, display names, and error strings; provider check in build_embeddings flow updated; update_build_config logic adjusted to set api_base advanced flag based on provider type and rename fields for IBM watsonx.ai

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Single-file change with straightforward renaming pattern
  • Conditional logic additions in update_build_config for provider-specific configuration handling may require verification of correct flag/field assignments

Possibly related PRs

Suggested reviewers

  • lucaseduoli

Pre-merge checks and finishing touches

❌ Failed checks (1 error, 2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Test Coverage For New Implementations ❌ Error The PR correctly updates the provider naming from "WatsonX" to "IBM watsonx.ai" in both embedding_model.py and the Nvidia Remix.json starter project file. However, the corresponding test file at src/backend/tests/unit/components/models/test_embedding_model_component.py was not updated and still contains 6 instances of the old "WatsonX" provider name (lines 78, 151, 170, 174, 187, 193). When these tests run, they will fail because the component now expects provider == "IBM watsonx.ai" but the tests pass provider="WatsonX", which will trigger the "Unknown provider" error at the end of build_embeddings(). Additionally, the PR introduces display name redundancy with "AI" appended twice ("IBM watsonx.ai AI API Key" and "IBM watsonx.ai AI URL") as noted in previous review comments. For a bug fix PR, regression tests must be updated to verify the changes work correctly. To satisfy the test coverage requirement, update src/backend/tests/unit/components/models/test_embedding_model_component.py by replacing all 6 occurrences of "WatsonX" with "IBM watsonx.ai" (lines 78, 151, 170, 174, 187, 193) and update corresponding error message assertions to match the new provider name. Additionally, fix the display name redundancy by changing "IBM watsonx.ai AI API Key" to "IBM watsonx.ai API Key" and "IBM watsonx.ai AI URL" to "IBM watsonx.ai URL" in the component code. Verify that all tests pass after these updates to ensure the regression tests properly validate the renamed provider functionality.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Test Quality And Coverage ⚠️ Warning The repository has real unit tests that exercise EmbeddingModelComponent (including async tests for build_embeddings and error cases) but the PR renamed the provider to "IBM watsonx.ai" while many tests and some error/display strings still reference "WatsonX" or "Watson AI" (notably src/backend/tests/unit/components/models/test_embedding_model_component.py contains multiple "WatsonX" assertions and src/lfx/src/lfx/components/models/embedding_model.py still has the inconsistent message "Watson AI API key is required..." and redundant "AI" in some display names). Because of those mismatches the existing tests will fail even though they cover the key success and failure paths (missing API key, missing project id, provider branching), and I also found ~17 repository test files referencing Watson/WATSONX patterns that likely need updates. Thus test coverage is functional but not aligned with the renamed provider and some user-facing strings, creating broken assertions and inconsistent messages. Update all tests to use the new provider string "IBM watsonx.ai" and adjust pytest assertions that expect the old "WatsonX" or "Watson AI" messages (start with src/backend/tests/unit/components/models/test_embedding_model_component.py), and fix embedding_model.py to use a single consistent error string and remove the duplicated "AI" in display names as noted in the review; run the full pytest suite and update any remaining ~17 test files that reference Watson/watsonx. After code and test string fixes, add/confirm assertions that validate both the success and error paths for build_embeddings and update_build_config (including project ID and API key validation) and ensure async tests follow the project's pytest async patterns so CI passes reliably.
Title Check ❓ Inconclusive The pull request title "fix: Improve appearance of IBM watsonX im Embedding Model component" is related to the changeset in that it references the Embedding Model component and Watson/IBM branding, which are both present in the changes. However, the title uses vague language ("Improve appearance") that doesn't clearly convey the primary change, which is renaming provider references from "WatsonX" to "IBM watsonx.ai" across configuration and logic. Additionally, the title contains apparent typos ("watsonX" inconsistent with the actual target "watsonx.ai", and "im" instead of "in"), which reduces clarity. A teammate reviewing the pull request history would not immediately understand that the main change involves rebranding the provider name throughout the component. Consider revising the title to more precisely describe the primary change. A clearer title might be something like "fix: Rename WatsonX provider to IBM watsonx.ai in Embedding Model component" which would immediately convey that this is a provider rebranding update. Also review the title for typos before merging.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Test File Naming And Structure ✅ Passed The test file test_embedding_model_component.py fully complies with all test file naming and structure requirements specified in the custom check. The file follows the backend test pattern test_*.py and is properly located in src/backend/tests/unit/components/models/. The single test class is correctly named TestEmbeddingModelComponent with the Test prefix, and all 10 test methods follow the test_ prefix convention with highly descriptive names that clearly indicate what is being tested. The tests include 3 well-designed fixtures for setup and teardown operations, utilize 7 patch/mock decorators for proper dependency isolation, and include 4 comprehensive error condition tests using pytest.raises. The test organization is logical, separating tests by provider (OpenAI, Ollama, WatsonX) and covering both positive scenarios (successful configuration and embeddings building) and negative scenarios (missing API keys, missing project IDs, unknown provider). This represents exemplary pytest structure and comprehensive test coverage.
Excessive Mock Usage Warning ✅ Passed The test file demonstrates excellent test design with minimal and appropriate mock usage. With only 3 @patch decorators across 10 tests (0.3 per test average), and 70% of tests using no mocks at all, this is well below problematic levels. The mocking is properly scoped to external third-party LangChain provider libraries (OpenAI, Ollama, WatsonX embeddings) rather than testing implementation details. Tests instantiate real EmbeddingModelComponent instances and verify actual configuration logic through 29 behavior assertions versus only 3 mock call assertions. The mock-related code comprises only 10.9% of the file, indicating mocks are used judiciously for isolation from external dependencies rather than being pervasive. This follows good testing practice by testing the component's real routing and configuration logic while appropriately isolating external provider calls.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the bug Something isn't working label Oct 31, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 31.23%. Comparing base (e9d1c2f) to head (99fc905).
⚠️ Report is 1 commits behind head on main.

❌ Your project status has failed because the head coverage (39.37%) is below the target coverage (60.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #10469   +/-   ##
=======================================
  Coverage   31.23%   31.23%           
=======================================
  Files        1324     1324           
  Lines       59908    59908           
  Branches     8960     8960           
=======================================
  Hits        18713    18713           
  Misses      40288    40288           
  Partials      907      907           
Flag Coverage Δ
backend 50.91% <ø> (ø)
frontend 13.11% <ø> (ø)
lfx 39.37% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Oct 31, 2025
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Oct 31, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 31, 2025

Frontend Unit Test Coverage Report

Coverage Summary

Lines Statements Branches Functions
Coverage: 14%
14.21% (3820/26872) 7.11% (1458/20501) 8.56% (504/5881)

Unit Test Results

Tests Skipped Failures Errors Time
1393 0 💤 0 ❌ 0 🔥 18.474s ⏱️

@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Oct 31, 2025
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e9d1c2f and 41a603d.

📒 Files selected for processing (2)
  • src/backend/base/langflow/initial_setup/starter_projects/Nvidia Remix.json (4 hunks)
  • src/lfx/src/lfx/components/models/embedding_model.py (5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: Lint Backend / Run Mypy (3.10)
  • GitHub Check: Lint Backend / Run Mypy (3.11)
  • GitHub Check: Lint Backend / Run Mypy (3.12)
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 5
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 3
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 4
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 1
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 2
  • GitHub Check: Run Backend Tests / Integration Tests - Python 3.10
  • GitHub Check: Test Docker Images / Test docker images
  • GitHub Check: Test Starter Templates
  • GitHub Check: Update Component Index
  • GitHub Check: Optimize new Python code in this PR
  • GitHub Check: test-starter-projects
🔇 Additional comments (5)
src/lfx/src/lfx/components/models/embedding_model.py (4)

65-65: LGTM!

The info text correctly reflects the updated provider name.


170-170: Verify the advanced flag setting aligns with UX requirements.

The api_base field for OpenAI is now marked as advanced=True, which will hide it from the basic view. Ensure this change aligns with the intended user experience, as users with custom OpenAI-compatible endpoints will need to expand the advanced section to configure this.


181-181: Verify the advanced flag setting aligns with UX requirements.

The api_base field for Ollama is now marked as advanced=True, which will hide it from the basic view despite having a default value set. Confirm this is intentional, as users running Ollama on non-default ports will need to expand the advanced section.


34-38: Remove redundant "AI" text from display names on lines 187 and 190.

The icon metadata using "WatsonxAI" is correct—this icon name is properly mapped in the frontend icon system. However, the display names contain redundant text:

  • Line 187: "IBM watsonx.ai AI API Key" should be "IBM watsonx.ai API Key"
  • Line 190: "IBM watsonx.ai AI URL" should be "IBM watsonx.ai URL"

Likely an incorrect or invalid review comment.

src/backend/base/langflow/initial_setup/starter_projects/Nvidia Remix.json (1)

1852-1852: No action needed on code_hash.

Hash change reflects content edits only.

Comment thread src/backend/base/langflow/initial_setup/starter_projects/Nvidia Remix.json Outdated
Comment thread src/lfx/src/lfx/components/models/embedding_model.py
Comment thread src/lfx/src/lfx/components/models/embedding_model.py
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Oct 31, 2025
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Oct 31, 2025
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e9d1c2f and 1b5a5bc.

📒 Files selected for processing (1)
  • src/lfx/src/lfx/components/models/embedding_model.py (5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 13/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 10/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 7/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 4/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 11/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 1/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 9/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 3/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 8/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 12/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 5/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 6/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 2/13
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 5
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 1
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 3
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 4
  • GitHub Check: Run Backend Tests / Integration Tests - Python 3.10
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 2
  • GitHub Check: Test Starter Templates
  • GitHub Check: Update Starter Projects
🔇 Additional comments (6)
src/lfx/src/lfx/components/models/embedding_model.py (6)

65-65: LGTM!

The info text has been correctly updated to reference "IBM watsonx.ai".


145-145: LGTM!

The error message correctly references "IBM watsonx.ai provider".


170-170: LGTM!

Setting the advanced flag to True for the API base URL fields when using OpenAI or Ollama providers is consistent with the initial field definition on Line 59 and appropriately hides these optional configuration details from the main view.

Also applies to: 181-181


184-184: LGTM!

The condition has been correctly updated to check for "IBM watsonx.ai".


192-192: LGTM!

Setting advanced=False for the IBM watsonx.ai API base URL is appropriate, as it makes this configuration more prominent in the UI. This differs from OpenAI and Ollama where the API base URL is optional/advanced, but for IBM watsonx.ai it appears to be a more essential configuration parameter.


34-38: Let me search for icon lookup and resolution logic to understand how the icon metadata is processed:

Now let me search for icon registry or provider icon mappings in the codebase:

Let me search more specifically for Watson/WatsonxAI icon assets or registrations:

Based on my verification, I can now provide the rewritten review comment:

Verify that the icon identifier "WatsonxAI" is properly mapped for the renamed provider "IBM watsonx.ai".

Langflow uses Lucide for icons, but Lucide does not accept brand logos. This means "WatsonxAI" is a custom icon registered in Langflow. The provider option has been renamed to "IBM watsonx.ai" on line 34, but the icon metadata on line 38 still references "WatsonxAI". If the icon lookup or registration mechanism depends on correlating the icon identifier with the provider name, this mismatch could cause the icon to fail to load in the UI. Verify that the custom icon registry has been updated to properly handle the new provider name and that both backend and frontend icon mappings are consistent.

Comment thread src/lfx/src/lfx/components/models/embedding_model.py
Comment thread src/lfx/src/lfx/components/models/embedding_model.py Outdated
Comment thread src/lfx/src/lfx/components/models/embedding_model.py Outdated
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Oct 31, 2025
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Oct 31, 2025
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Oct 31, 2025
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Oct 31, 2025
Copy link
Copy Markdown
Collaborator

@edwinjosechittilappilly edwinjosechittilappilly left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions Bot added the lgtm This PR has been approved by a maintainer label Nov 2, 2025
@edwinjosechittilappilly edwinjosechittilappilly added this pull request to the merge queue Nov 2, 2025
Merged via the queue into main with commit 2c25225 Nov 2, 2025
82 of 83 checks passed
@edwinjosechittilappilly edwinjosechittilappilly deleted the fix-embed-model-watson branch November 2, 2025 04:54
korenLazar pushed a commit to kiran-kate/langflow that referenced this pull request Nov 13, 2025
…angflow-ai#10469)

* Fix appearance of IBM watsonX

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* [autofix.ci] apply automated fixes (attempt 3/3)

* Update embedding_model.py

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* Update test_embedding_model_component.py

* Update Nvidia Remix.json

* [autofix.ci] apply automated fixes

* Update test_embedding_model_component.py

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants