feat: agentics IBM bundle#11490
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 Use the checkbox below for a quick retry:
WalkthroughIntroduces a new Agentics component for language-model-driven DataFrame transformation alongside a corresponding React SVG icon. The backend component integrates multiple LLM providers (IBM WatsonX, Google Generative AI, OpenAI), manages schema validation, and implements metadata enrichment workflows. Changes
Sequence DiagramsequenceDiagram
actor User
participant AgenticsComponent
participant ModelResolver
participant ProviderConfig
participant LLMClient
participant DataFrame as AG/DataFrame
User->>AgenticsComponent: transduce()
AgenticsComponent->>ModelResolver: resolve model class from metadata
ModelResolver-->>AgenticsComponent: model class
AgenticsComponent->>ProviderConfig: fetch API key for provider
ProviderConfig-->>AgenticsComponent: API key (or error)
AgenticsComponent->>LLMClient: initialize (WatsonX/Google/OpenAI)
LLMClient-->>AgenticsComponent: ready
AgenticsComponent->>DataFrame: convert to AG typed object
DataFrame-->>AgenticsComponent: typed source
AgenticsComponent->>LLMClient: transform with schema
LLMClient->>DataFrame: apply model transformation
DataFrame-->>LLMClient: results
AgenticsComponent->>AgenticsComponent: enrich metadata (if enabled)
AgenticsComponent-->>User: list of dictionaries
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 3❌ Failed checks (1 error, 2 warnings)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Fix all issues with AI agents
In `@src/frontend/src/icons/Agentics/index.tsx`:
- Line 3: The import path is incorrect: replace the broken import of SvgAgentQL
from "./AgentQL" with the actual module filename (Agentics.jsx) used in the
codebase so the default export referenced as SvgAgentQL is resolved; update the
import statement in src/frontend/src/icons/Agentics/index.tsx to import the
default export from "Agentics.jsx" (the module that defines the SVG component)
so SvgAgentQL points to the correct component.
- Around line 5-10: The export/import names in the Agentics icon module are
inconsistent: change the component and import references from AgentQLIcon and
SvgAgentQL to AgenticsIcon and SvgAgentics (matching the SVG file Agentics.jsx
and the backend icon name "Agentics"), update the default/exported symbol to
AgenticsIcon in src/frontend/src/icons/Agentics/index.tsx, and then register the
icon in src/frontend/src/icons/lazyIconImports.ts by adding an entry for
"Agentics" that lazy-imports the module and returns the AgenticsIcon as the
default export.
In `@src/lfx/src/lfx/components/agentics/agentics.py`:
- Line 34: The description string in agentics.py currently has a typo: change
the value of the variable named description (in the agentics module) from
"Enables Map Reduce Style Agentic data transformations amongs dataframes" to use
the correct word "among" so it reads "Enables Map Reduce Style Agentic data
transformations among dataframes".
- Around line 193-194: The code accesses self.model[0] in the agentics component
which will raise IndexError if self.model is empty; modify the logic around the
assignment to validate that self.model is a non-empty list (or iterable) before
reading index 0 (e.g., check if self.model and len(self.model) > 0 or handle
None), and if it's empty handle the error path — for example set a safe default,
raise a clear ValueError, or log and return — updating all use-sites that expect
model_selection to handle the chosen fallback; refer to the symbol
model_selection and the attribute self.model to locate where to add this
validation and error handling.
- Around line 6-9: Wrap the top-level imports for agentics and crewai in
try/except blocks so AG and LLM are set to None on ImportError (and leave
create_pydantic_model and generate_prototypical_instances similarly guarded or
imported from AG when available), and add a runtime guard at the start of the
transduce() method that checks if AG is None or LLM is None and raises an
informative ImportError instructing how to install the missing packages;
reference the AG and LLM symbols for the imports and the transduce() method to
locate where to add the checks.
- Around line 231-232: The else branch currently returns the string "Please fix
model paramters" despite the method being declared to return a DataFrame;
replace that return with raising a descriptive exception (e.g., ValueError) and
correct the typo to "parameters" so callers receive an error instead of an
unexpected string; update the branch in the containing function (the method with
the -> DataFrame annotation that returns "Please fix model paramters") to raise
ValueError("Please fix model parameters") or a similarly appropriate exception.
🧹 Nitpick comments (3)
src/frontend/src/icons/Agentics/Agentics.jsx (1)
1-48: Missing dark mode support viaisDarkprop.As per coding guidelines, SVG icon components should use the
isDarkprop to switch between light and dark color schemes. While this gradient-based icon may render acceptably in both modes, the component should still accept theisDarkprop for consistency with other icons in the codebase.Additionally, there's a naming inconsistency: the component is named
SvgAgentQLbut the directory and backend component useAgentics(icon = "Agentics"). Consider renaming toSvgAgenticsfor consistency.♻️ Proposed fix to add isDark prop support and fix naming
-const SvgAgentQL = (props) => ( +const SvgAgentics = (props) => ( <svg width="512" height="512" ... ); -export default SvgAgentQL; +export default SvgAgentics;src/lfx/src/lfx/components/agentics/agentics.py (2)
159-186: Unused helper methods reference undefined attributes.
_create_base_rowand_add_metadatareferenceself.output_column_nameandself.enable_metadata, but these are not defined in the component'sinputs. These methods appear to be unused intransduce().Consider removing these dead code methods, or if they're planned for future use, define the corresponding inputs:
StrInput(name="output_column_name", display_name="Output Column Name", value="output", advanced=True), BoolInput(name="enable_metadata", display_name="Enable Metadata", value=False, advanced=True),
205-206: Move import to top of file.The import of
get_api_key_for_provideris already available at the module level (line 11-15). This local import is redundant.♻️ Proposed fix
- # Get API key from global variables - from lfx.base.models.unified_models import get_api_key_for_provider - api_key = get_api_key_for_provider(self.user_id, provider, self.api_key)And add to the existing import at line 11:
from lfx.base.models.unified_models import ( + get_api_key_for_provider, get_language_model_options, get_model_classes, update_model_options_in_build_config, )
…o/langflow into feature/agentics_bundle_2
|
@gliozzo I pushed an update to the docs to make them more readable. Your examples and information are still there. I am approving for docs. |
…m/gliozzo/langflow into feature/agentics_bundle_2" This reverts commit f048f03, reversing changes made to 7e99bc8.
…mportable Made-with: Cursor
…ndex conflict by rebuilding Made-with: Cursor
Made-with: Cursor
…ndex conflict by rebuilding Made-with: Cursor
… component connections
…ow-ai/langflow into feature/agentics_bundle_2
…o/langflow into feature/agentics_bundle_2
This PR updates the custom Agentics component to ensure it works correctly with Langflow env
The contributed component is here src/lfx/src/lfx/components/agentics/agentics.py
The icon is here src/frontend/src/icons/Agentics
ISSUES: agentics-py is not installed and has dependency conflicts. Need to install it before running langflow (after make init is done): uv pip install agentics-py
TODO:
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.