fix: Improve appearance of IBM watsonX im Embedding Model component#10469
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 error, 2 warnings, 1 inconclusive)
✅ Passed checks (3 passed)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ 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@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 3
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 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_basefield for OpenAI is now marked asadvanced=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_basefield for Ollama is now marked asadvanced=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.
There was a problem hiding this comment.
Actionable comments posted: 3
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 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
advancedflag toTruefor 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=Falsefor 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.
…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>
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:
"WatsonX"to"IBM watsonx.ai"in both the provider options and user-facing info strings inEmbeddingModelComponentand 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:
build_embeddingsto check for"IBM watsonx.ai"as the provider, and revised error messages to reference the new provider name for better clarity.Configuration logic improvements:
update_build_configmethod to handle the new provider name, set appropriate display names, and toggle theadvancedflag for API base URLs to match provider requirements. [1] [2]Starter project code hash update:
code_hashinNvidia Remix.jsonto reflect changes in the code logic and configuration.Summary by CodeRabbit