Skip to content

feat: integrate helicone as a bundle and as an agent provider#10433

Closed
H2Shami wants to merge 4 commits into
langflow-ai:mainfrom
H2Shami:helicone-integration
Closed

feat: integrate helicone as a bundle and as an agent provider#10433
H2Shami wants to merge 4 commits into
langflow-ai:mainfrom
H2Shami:helicone-integration

Conversation

@H2Shami
Copy link
Copy Markdown

@H2Shami H2Shami commented Oct 28, 2025

Summary by CodeRabbit

  • New Features

    • Added Helicone as a selectable model provider with UI for API key, model selection, temperature, and max tokens.
    • New Helicone icon and sidebar entry; Helicone is now available in model/provider lists and component pickers.
    • On-demand Helicone component enables discovery of available Helicone-backed models.
  • Documentation

    • Added a Helicone bundle docs page with configuration details, parameter table, and reference links.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Oct 28, 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.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds Helicone bundle: documentation and sidebar entry, frontend SVG icon and lazy import, dropdown search memoization, backend provider registration and model metadata, a new HeliconeComponent with model discovery and LangChain ChatOpenAI build logic, and lazy-loading component exports.

Changes

Cohort / File(s) Summary
Documentation
docs/docs/Components/bundles-helicone.mdx, docs/sidebars.js
New Helicone docs page with frontmatter, parameters table (api_key, model_name, temperature, max_tokens); sidebar updated to include Components → Bundles → bundles-helicone.
Frontend Icons & Lazy Loading
src/frontend/src/icons/Helicone/HeliconeIcon.jsx, src/frontend/src/icons/Helicone/index.tsx, src/frontend/src/icons/lazyIconImports.ts
Add SvgHelicone SVG component, a forwardRef HeliconeIcon wrapper, and a lazy-icons mapping entry for on-demand import.
Frontend Search Logic
src/frontend/src/components/core/dropdownComponent/index.tsx
Memoize Fuse options as { value } items, construct Fuse over value with threshold 0.3, and map Fuse results to search.item.value; comments added.
Frontend Styling
src/frontend/src/utils/styleUtils.ts
Added Helicone entry to SIDEBAR_BUNDLES (display_name "Helicone", name "helicone", icon "Helicone").
Backend Model Provider Setup
src/lfx/src/lfx/base/models/model_input_constants.py
Added _get_helicone_inputs_and_fields() helper; registered Helicone in MODEL_PROVIDERS_DICT, MODEL_PROVIDERS_LIST, ACTIVE_MODEL_PROVIDERS_DICT, and related metadata generation.
Backend Component Registration
src/lfx/src/lfx/components/__init__.py, src/lfx/src/lfx/components/helicone/__init__.py
Expose helicone in TYPE_CHECKING, dynamic imports map, discovery list, and __all__; helicone package implements module-level __getattr__, __dir__, and __all__ = ["HeliconeComponent"] for lazy attribute import.
Backend Component Implementation
src/lfx/src/lfx/components/helicone/helicone.py
New HeliconeComponent (extends LCModelComponent) with inputs (api_key, model_name, temperature, max_tokens), fetch_models(), update_build_config(), and build_model() that validates inputs and constructs a LangChain ChatOpenAI model via Helicone gateway; includes normalization and defensive parsing of registry responses.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Frontend
    participant HeliconeComponent
    participant HeliconeAPI
    participant LangChain

    User->>Frontend: select Helicone bundle
    Frontend->>HeliconeComponent: request model options
    HeliconeComponent->>HeliconeAPI: fetch_models()
    HeliconeAPI-->>HeliconeComponent: registry response (varied shapes)
    HeliconeComponent->>HeliconeComponent: normalize models, update_build_config()
    HeliconeComponent-->>Frontend: return options + metadata
    User->>Frontend: select model & provide params
    Frontend->>HeliconeComponent: build_model()
    HeliconeComponent->>HeliconeComponent: validate inputs
    HeliconeComponent->>LangChain: instantiate ChatOpenAI via Helicone gateway
    LangChain-->>HeliconeComponent: LanguageModel instance ready
    HeliconeComponent-->>Frontend: model ready for use
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Areas to focus review on:

  • src/lfx/src/lfx/components/helicone/helicone.py — normalization of heterogeneous registry responses, error handling, and correctness of LangChain model construction.
  • src/frontend/src/components/core/dropdownComponent/index.tsx — verify Fuse item-shape change and typing.
  • src/lfx/src/lfx/base/models/model_input_constants.py — integration into provider lists, defaults, and activation logic.
  • Lazy-import behavior and public API exposure: src/lfx/src/lfx/components/__init__.py and src/lfx/src/lfx/components/helicone/__init__.py.

Possibly related PRs

Suggested labels

enhancement, size:M

Suggested reviewers

  • erichare
  • mendonk
  • edwinjosechittilappilly

Pre-merge checks and finishing touches

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Test Coverage For New Implementations ❌ Error PR adds HeliconeComponent, Helicone icon, dropdown changes, and model integration without corresponding test files. Add test_helicone.py for HeliconeComponent methods and tests for _get_helicone_inputs_and_fields() function, plus frontend component tests.
Test Quality And Coverage ⚠️ Warning Helicone component has no test files despite implementing critical API-calling methods with complex business logic for model discovery and configuration. Add unit tests for fetch_models(), update_build_config(), and build_model() methods with mocked Helicone API responses, error handling scenarios, and integration tests with the model provider system.
Test File Naming And Structure ⚠️ Warning PR introduces 11 new files with backend and frontend components but adds zero test files for critical functionality like API calls and model discovery. Create test_helicone.py with pytest tests for fetch_models(), update_build_config(), build_model() methods and *.test.tsx for HeliconeIcon component covering positive/negative scenarios and error conditions.
Excessive Mock Usage Warning ❓ Inconclusive PR adds production code for HeliconeComponent with API integration but includes no test files to assess mock usage. Add test files covering HeliconeComponent functionality. Mock only external API calls and HTTP requests; verify configuration management with real objects.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: integrating Helicone as both a bundle and agent provider, which is reflected across documentation, icons, and backend components.

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.

@H2Shami H2Shami force-pushed the helicone-integration branch from 4580e5c to 5e273bb Compare October 28, 2025 22:59
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: 1

🧹 Nitpick comments (4)
docs/docs/Components/bundles-helicone.mdx (1)

1-36: LGTM! Documentation is well-structured.

The documentation follows Docusaurus best practices with proper front matter, clear headings in sentence case, and a well-organized parameters table. The external link to Helicone's documentation is helpful for users.

Consider adding a code example showing how to use the Helicone component in a flow, similar to other bundle documentation pages. This would help users get started more quickly.

src/lfx/src/lfx/base/models/model_input_constants.py (1)

337-337: Consider deriving MODEL_PROVIDERS_LIST dynamically.

The hardcoded list ["Anthropic", "Google Generative AI", "Helicone", "OpenAI"] could fall out of sync when providers are added or when is_active flags change. Consider deriving it from ACTIVE_MODEL_PROVIDERS_DICT.keys() instead, or documenting why this specific subset is manually maintained.

Apply this diff to derive the list dynamically:

-MODEL_PROVIDERS_LIST = ["Anthropic", "Google Generative AI", "Helicone", "OpenAI"]
+MODEL_PROVIDERS_LIST = list(ACTIVE_MODEL_PROVIDERS_DICT.keys())

If the order matters, you can sort it:

-MODEL_PROVIDERS_LIST = ["Anthropic", "Google Generative AI", "Helicone", "OpenAI"]
+MODEL_PROVIDERS_LIST = sorted(ACTIVE_MODEL_PROVIDERS_DICT.keys())
src/lfx/src/lfx/components/helicone/helicone.py (2)

184-184: Simplify the conditional attribute access.

The expression build_config.get("model_name") if hasattr(build_config, "get") else build_config["model_name"] is overly defensive. Since build_config is typed as dict, it will always have a get method. The fallback to dictionary indexing could still raise KeyError if "model_name" is missing.

Simplify to:

-model_cfg = build_config.get("model_name") if hasattr(build_config, "get") else build_config["model_name"]
+model_cfg = build_config["model_name"]

This will raise a clear KeyError if the key is missing, which is appropriate since "model_name" should always be present in the build config for this component.


262-262: Consider simplifying the API key handling.

The expression SecretStr(self.api_key).get_secret_value() wraps the API key in SecretStr and immediately extracts it. Since self.api_key comes from a SecretStrInput that validates to a string (see line 26 and the SecretStrInput definition), you can pass it directly.

Simplify to:

-"openai_api_key": SecretStr(self.api_key).get_secret_value(),
+"openai_api_key": self.api_key,

This assumes ChatOpenAI accepts a plain string for openai_api_key, which is standard. If ChatOpenAI specifically requires a SecretStr object, the current code should wrap without calling get_secret_value():

-"openai_api_key": SecretStr(self.api_key).get_secret_value(),
+"openai_api_key": SecretStr(self.api_key),
📜 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 722c6cc and 5e273bb.

⛔ Files ignored due to path filters (1)
  • src/frontend/src/icons/Helicone/helicone.svg is excluded by !**/*.svg
📒 Files selected for processing (11)
  • docs/docs/Components/bundles-helicone.mdx (1 hunks)
  • docs/sidebars.js (1 hunks)
  • src/frontend/src/components/core/dropdownComponent/index.tsx (2 hunks)
  • src/frontend/src/icons/Helicone/HeliconeIcon.jsx (1 hunks)
  • src/frontend/src/icons/Helicone/index.tsx (1 hunks)
  • src/frontend/src/icons/lazyIconImports.ts (1 hunks)
  • src/frontend/src/utils/styleUtils.ts (1 hunks)
  • src/lfx/src/lfx/base/models/model_input_constants.py (4 hunks)
  • src/lfx/src/lfx/components/__init__.py (3 hunks)
  • src/lfx/src/lfx/components/helicone/__init__.py (1 hunks)
  • src/lfx/src/lfx/components/helicone/helicone.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (11)
src/frontend/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/frontend_development.mdc)

src/frontend/src/**/*.{ts,tsx,js,jsx}: All frontend TypeScript and JavaScript code should be located under src/frontend/src/ and organized into components, pages, icons, stores, types, utils, hooks, services, and assets directories as per the specified directory layout.
Use React 18 with TypeScript for all UI components in the frontend.
Format all TypeScript and JavaScript code using the make format_frontend command.
Lint all TypeScript and JavaScript code using the make lint command.

Files:

  • src/frontend/src/icons/Helicone/HeliconeIcon.jsx
  • src/frontend/src/icons/lazyIconImports.ts
  • src/frontend/src/components/core/dropdownComponent/index.tsx
  • src/frontend/src/icons/Helicone/index.tsx
  • src/frontend/src/utils/styleUtils.ts
src/frontend/src/icons/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/frontend_development.mdc)

Use Lucide React for icons in the frontend.

Files:

  • src/frontend/src/icons/Helicone/HeliconeIcon.jsx
  • src/frontend/src/icons/lazyIconImports.ts
  • src/frontend/src/icons/Helicone/index.tsx
src/frontend/src/icons/*/*.@(js|jsx|ts|tsx)

📄 CodeRabbit inference engine (.cursor/rules/icons.mdc)

Create a new directory for your icon in src/frontend/src/icons/YourIconName/ and add your SVG as a React component (e.g., YourIconName.jsx). The SVG component must use the isDark prop to support both light and dark mode.

Files:

  • src/frontend/src/icons/Helicone/HeliconeIcon.jsx
  • src/frontend/src/icons/Helicone/index.tsx
src/frontend/src/icons/lazyIconImports.ts

📄 CodeRabbit inference engine (.cursor/rules/icons.mdc)

Add your icon to the lazyIconsMapping object in src/frontend/src/icons/lazyIconImports.ts with a key that matches the backend icon string exactly.

Files:

  • src/frontend/src/icons/lazyIconImports.ts
src/frontend/src/components/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/frontend_development.mdc)

All components should be styled using Tailwind CSS utility classes.

Files:

  • src/frontend/src/components/core/dropdownComponent/index.tsx
src/frontend/src/@(components|hooks)/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/frontend_development.mdc)

Implement dark mode support in components and hooks where needed.

Files:

  • src/frontend/src/components/core/dropdownComponent/index.tsx
src/frontend/src/icons/*/index.tsx

📄 CodeRabbit inference engine (.cursor/rules/icons.mdc)

Create an index.tsx in your icon directory that exports your icon using forwardRef and passes the isDark prop.

Files:

  • src/frontend/src/icons/Helicone/index.tsx
src/frontend/src/utils/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/frontend_development.mdc)

All utility functions should be placed in the utils directory.

Files:

  • src/frontend/src/utils/styleUtils.ts
docs/sidebars.js

📄 CodeRabbit inference engine (.cursor/rules/docs_development.mdc)

Keep sidebars.js updated to include new/changed docs sections and items using Docusaurus category structure

Files:

  • docs/sidebars.js
docs/**/*.{md,mdx}

📄 CodeRabbit inference engine (.cursor/rules/docs_development.mdc)

docs/**/*.{md,mdx}: All Markdown/MDX pages must start with front matter including at least title and description; include sidebar_position for docs pages when applicable
Code blocks must specify a language and may include a title (```lang title="…")
Use sentence case for headings and keep paragraphs short and scannable
Write in second person, present tense, with a professional but approachable tone
Use inline code with backticks for code terms; use bold for UI elements and italics for emphasis; keep lists in parallel structure
Ensure internal links are functional and navigation works (update cross-references as needed)
Verify all code examples in docs and blog actually run as shown
Use correct terminology capitalization: Langflow, Component, Flow, API, JSON
Reference images with absolute paths under /img/... and provide descriptive alt text

Files:

  • docs/docs/Components/bundles-helicone.mdx
docs/docs/**/*.{md,mdx}

📄 CodeRabbit inference engine (.cursor/rules/docs_development.mdc)

Use Docusaurus admonitions (:::+tip|warning|danger) instead of custom callouts in docs pages

Files:

  • docs/docs/Components/bundles-helicone.mdx
🧠 Learnings (6)
📚 Learning: 2025-07-28T15:56:47.865Z
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-07-28T15:56:47.865Z
Learning: Applies to src/frontend/src/icons/*/*.@(js|jsx|ts|tsx) : Create a new directory for your icon in `src/frontend/src/icons/YourIconName/` and add your SVG as a React component (e.g., `YourIconName.jsx`). The SVG component must use the `isDark` prop to support both light and dark mode.

Applied to files:

  • src/frontend/src/icons/Helicone/HeliconeIcon.jsx
📚 Learning: 2025-07-28T15:56:47.865Z
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-07-28T15:56:47.865Z
Learning: Applies to src/frontend/src/icons/lazyIconImports.ts : Add your icon to the `lazyIconsMapping` object in `src/frontend/src/icons/lazyIconImports.ts` with a key that matches the backend icon string exactly.

Applied to files:

  • src/frontend/src/icons/lazyIconImports.ts
📚 Learning: 2025-06-23T12:46:52.420Z
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: Export custom icon components in React using React.forwardRef to ensure proper ref forwarding and compatibility with parent components.

Applied to files:

  • src/frontend/src/icons/Helicone/index.tsx
📚 Learning: 2025-07-28T15:56:47.865Z
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-07-28T15:56:47.865Z
Learning: Applies to src/frontend/src/icons/*/index.tsx : Create an `index.tsx` in your icon directory that exports your icon using `forwardRef` and passes the `isDark` prop.

Applied to files:

  • src/frontend/src/icons/Helicone/index.tsx
📚 Learning: 2025-06-16T11:14:04.200Z
Learnt from: dolfim-ibm
PR: langflow-ai/langflow#8394
File: src/frontend/src/icons/Docling/index.tsx:4-6
Timestamp: 2025-06-16T11:14:04.200Z
Learning: The Langflow codebase consistently uses `React.PropsWithChildren<{}>` as the prop type for all icon components using forwardRef, rather than `React.SVGProps<SVGSVGElement>`. This is an established pattern across hundreds of icon files in src/frontend/src/icons/.

Applied to files:

  • src/frontend/src/icons/Helicone/index.tsx
📚 Learning: 2025-09-30T00:09:51.631Z
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-09-30T00:09:51.631Z
Learning: Applies to docs/sidebars.js : Keep sidebars.js updated to include new/changed docs sections and items using Docusaurus category structure

Applied to files:

  • docs/sidebars.js
🧬 Code graph analysis (4)
src/lfx/src/lfx/base/models/model_input_constants.py (1)
src/lfx/src/lfx/components/helicone/helicone.py (1)
  • HeliconeComponent (14-270)
src/frontend/src/icons/Helicone/index.tsx (1)
src/frontend/src/icons/Helicone/HeliconeIcon.jsx (1)
  • SvgHelicone (1-81)
src/lfx/src/lfx/components/helicone/__init__.py (1)
src/lfx/src/lfx/components/helicone/helicone.py (1)
  • HeliconeComponent (14-270)
src/lfx/src/lfx/components/helicone/helicone.py (3)
src/lfx/src/lfx/base/models/model.py (1)
  • LCModelComponent (25-375)
src/lfx/src/lfx/inputs/inputs.py (4)
  • DropdownInput (465-490)
  • IntInput (344-376)
  • SecretStrInput (286-341)
  • SliderInput (642-643)
src/lfx/src/lfx/custom/custom_component/component.py (2)
  • get_base_inputs (167-170)
  • log (1480-1497)
⏰ 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). (22)
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 13/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 4/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 12/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 11/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 9/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 2/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 7/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 10/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 8/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 3/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 6/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 5/13
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 1/13
  • GitHub Check: Test Docker Images / Test docker images
  • GitHub Check: Test Docs Build / Test Docs Build
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 2
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 4
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 3
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 5
  • GitHub Check: Run Backend Tests / Integration Tests - Python 3.10
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 1
  • GitHub Check: Test Starter Templates
🔇 Additional comments (15)
src/frontend/src/utils/styleUtils.ts (1)

285-285: LGTM! Helicone bundle entry added correctly.

The new Helicone entry follows the established pattern and is correctly positioned in alphabetical order.

src/frontend/src/components/core/dropdownComponent/index.tsx (2)

101-106: LGTM! Fuse search properly memoized.

The memoization of Fuse initialization is a good performance optimization. The approach of wrapping string options in { value } objects to enable Fuse's key-based indexing is correct, and the comments clearly explain the rationale.


144-146: LGTM! Search results correctly mapped.

The mapping from res.item.value back to raw string values is consistent with the { value } wrapper structure used in the memoized Fuse setup.

docs/sidebars.js (1)

319-319: LGTM! Sidebar entry added correctly.

The Helicone documentation entry is properly positioned in alphabetical order and follows the established Docusaurus structure.

Based on learnings

src/frontend/src/icons/lazyIconImports.ts (1)

238-241: LGTM! Helicone icon lazy import added correctly.

The lazy import entry follows the established pattern and is correctly positioned in alphabetical order. The mapping to mod.HeliconeIcon aligns with the export from src/frontend/src/icons/Helicone/index.tsx.

Based on learnings

src/frontend/src/icons/Helicone/index.tsx (1)

1-10: LGTM! Icon wrapper follows established pattern.

The HeliconeIcon forwardRef wrapper correctly follows the codebase convention of using React.PropsWithChildren<{}> and properly forwards the ref and props to the underlying SvgHelicone component.

Based on learnings

src/lfx/src/lfx/components/__init__.py (1)

50-50: LGTM! Helicone component properly registered.

The helicone component is correctly added to:

  1. TYPE_CHECKING imports for type hints
  2. _dynamic_imports mapping for lazy loading
  3. __all__ for public module exports

All three additions follow the established pattern and are positioned in alphabetical order.

Also applies to: 153-153, 284-284

src/lfx/src/lfx/components/helicone/__init__.py (1)

1-32: LGTM! Clean lazy-loading implementation.

The module correctly implements lazy attribute-based importing following the established pattern. The error handling, caching, and __dir__ implementation are all appropriate.

src/lfx/src/lfx/base/models/model_input_constants.py (3)

175-183: LGTM! Helicone helper follows the established pattern.

The helper function correctly follows the same pattern as other provider helpers (OpenAI, Anthropic, etc.) with appropriate error messaging.


43-46: Change verified as safe—no component breakage detected.

All components with tool_model_enabled have explicit value= overrides in their BoolInput definitions, so the default change in model_input_constants.py (line 46) has no impact on existing workflows:

  • Ollama: explicitly value=True (preserved)
  • Nvidia, Groq, Google, Anthropic: explicitly value=False (aligned with new default)

Tests already expect False values, confirming alignment with this change. Components dynamically read the flag during update_build_config, maintaining full functionality.


309-322: Reconsider whether Helicone should be marked is_active=True by default for immediate rollout.

The data shows providers are roughly split: 4 with is_active=True (OpenAI, Anthropic, Google Generative AI, and Helicone) and 5 with is_active=False (Azure, Groq, NVIDIA, Bedrock, SambaNova). While the "most are False" claim is only narrowly supported, the underlying concern is valid. Helicone is an observability component (wrapped in try-except), not a model provider. Setting is_active=True means it will be immediately available to all users. Confirm that Helicone's adoption level and maturity warrant immediate activation, or consider marking it is_active=False for a staged rollout phase.

src/lfx/src/lfx/components/helicone/helicone.py (4)

1-44: LGTM! Component definition follows established patterns.

The component correctly:

  • Inherits from LCModelComponent
  • Defines appropriate metadata (display_name, description, icon)
  • Configures inputs with refresh capabilities for dynamic model loading
  • Uses base inputs from the parent class

The use of pydantic.v1.SecretStr is consistent with LangChain's current pydantic v1 dependency.


46-178: Robust model fetching with excellent fallback handling.

The implementation demonstrates strong defensive programming:

  • Handles multiple API response shapes gracefully
  • Uses depth-limited recursion to avoid infinite loops (MAX_NESTED_DEPTH=3)
  • Normalizes model metadata across various field naming conventions
  • Provides rich metadata for UI tooltips (context length, modalities, tool support)
  • Logs errors without crashing

The synchronous httpx.get call is acceptable here since this is triggered by explicit user action (refresh button) rather than in a request path.


180-249: Well-structured config update with defensive error handling.

The method correctly:

  • Fetches models dynamically
  • Builds rich metadata for UI rendering (tooltips, options_metadata)
  • Preserves the current value when valid
  • Fails gracefully without breaking the UI

The defensive try/except at lines 245-248 ensures stability even when model fetching fails.


251-270: Clean model building with appropriate validation.

The method correctly:

  • Validates required inputs (API key and model selection)
  • Configures the ChatOpenAI model to use Helicone's gateway
  • Sets reasonable defaults (temperature 0.7)
  • Conditionally includes max_tokens

Comment on lines +1 to +82
const SvgHelicone = (props) => (
<svg
width="1000"
height="1000"
viewBox="0 0 1000 1000"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<path
d="M512.259 82.0808C503.242 78.136 492.988 78.136 483.971 82.0808L75.8928 260.615L403.33 403.869L498.115 445.337L807.242 310.094L920.337 260.615L512.259 82.0808Z"
fill="#F8FEFF"
/>
<path
d="M75.8928 260.615V641.369L403.33 403.869L75.8928 260.615Z"
fill="#F8FEFF"
/>
<path
d="M807.242 310.094L498.115 445.337V486.806V784.623L807.242 310.094Z"
fill="#F8FEFF"
/>
<path
d="M498.115 784.623V924.107L592.361 884.557L920.337 358.631V260.615L807.242 310.094L498.115 784.623Z"
fill="#F8FEFF"
/>
<path
d="M498.115 924.107V784.623V486.806L113.591 762.744L498.115 924.107Z"
fill="#F8FEFF"
/>
<path
d="M75.8928 641.369V723.464C75.8928 737.677 84.4199 750.503 97.5257 756.003L113.591 762.744L498.115 486.806V445.337L403.33 403.869L75.8928 641.369Z"
fill="#F8FEFF"
/>
<path
d="M592.361 884.557L898.704 756.003C911.81 750.503 920.337 737.677 920.337 723.464V358.631L592.361 884.557Z"
fill="#F8FEFF"
/>
<path
d="M75.8928 260.615L483.971 82.0808C492.988 78.136 503.242 78.136 512.259 82.0808L920.337 260.615M75.8928 260.615V641.369M75.8928 260.615L403.33 403.869M920.337 260.615L807.242 310.094M920.337 260.615V358.631M498.115 924.107V784.623M498.115 924.107L592.361 884.557M498.115 924.107L113.591 762.744M498.115 445.337L807.242 310.094M498.115 445.337L403.33 403.869M498.115 445.337V486.806M498.115 784.623L807.242 310.094M498.115 784.623V486.806M592.361 884.557L898.704 756.003C911.81 750.503 920.337 737.677 920.337 723.464V358.631M592.361 884.557L920.337 358.631M75.8928 641.369V723.464C75.8928 737.677 84.4199 750.503 97.5257 756.003L113.591 762.744M75.8928 641.369L403.33 403.869M113.591 762.744L498.115 486.806"
stroke="#F8FEFF"
stroke-width="30.1587"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M505.498 116.609C501.993 115.076 498.007 115.076 494.502 116.609L115.919 282.24L413.778 412.553L500 450.275L781.203 327.249L884.081 282.24L505.498 116.609Z"
fill="#0CA5E9"
/>
<path
d="M115.919 282.24V628.599L413.778 412.553L115.919 282.24Z"
fill="#0CA5E9"
/>
<path
d="M781.203 327.249L500 450.275V487.997V758.912L781.203 327.249Z"
fill="#0CA5E9"
/>
<path
d="M500 758.912V885.796L585.732 849.819L884.081 371.401V282.24L781.203 327.249L500 758.912Z"
fill="#C2FCF6"
/>
<path
d="M500 885.796V758.912V487.997L150.212 739.01L500 885.796Z"
fill="#F8FEFF"
/>
<path
d="M115.919 628.599V715.499C115.919 721.024 119.233 726.01 124.328 728.148L150.212 739.01L500 487.997V450.275L413.778 412.553L115.919 628.599Z"
fill="#F8FEFF"
/>
<path
d="M585.732 849.819L875.672 728.148C880.767 726.01 884.081 721.024 884.081 715.499V371.401L585.732 849.819Z"
fill="#F8FEFF"
/>
<path
d="M115.919 282.24L494.502 116.609C498.007 115.076 501.993 115.076 505.498 116.609L884.081 282.24M115.919 282.24V628.599M115.919 282.24L413.778 412.553M884.081 282.24L781.203 327.249M884.081 282.24V371.401M500 885.796V758.912M500 885.796L585.732 849.819M500 885.796L150.212 739.01M500 450.275L781.203 327.249M500 450.275L413.778 412.553M500 450.275V487.997M500 758.912L781.203 327.249M500 758.912V487.997M585.732 849.819L875.672 728.148C880.767 726.01 884.081 721.024 884.081 715.499V371.401M585.732 849.819L884.081 371.401M115.919 628.599V715.499C115.919 721.024 119.233 726.01 124.328 728.148L150.212 739.01M115.919 628.599L413.778 412.553M150.212 739.01L500 487.997"
stroke="#1E1E1E"
stroke-width="27.4344"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
);
export default SvgHelicone;
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.

⚠️ Potential issue | 🟡 Minor

Missing isDark prop for theme support.

According to the coding guidelines, icon SVG components must use the isDark prop to support both light and dark mode. The current implementation does not incorporate theme-aware styling.

Consider adding the isDark prop and adjusting colors accordingly:

-const SvgHelicone = (props) => (
+const SvgHelicone = ({ isDark, ...props }) => (
   <svg
     width="1000"
     height="1000"
     viewBox="0 0 1000 1000"
     fill="none"
     xmlns="http://www.w3.org/2000/svg"
     {...props}
   >
     <path
       d="M512.259 82.0808C503.242 78.136 492.988 78.136 483.971 82.0808L75.8928 260.615L403.33 403.869L498.115 445.337L807.242 310.094L920.337 260.615L512.259 82.0808Z"
-      fill="#F8FEFF"
+      fill={isDark ? "#F8FEFF" : "#F8FEFF"}
     />
     {/* Apply similar changes to other paths based on design requirements */}
   </svg>
 );

As per coding guidelines

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/frontend/src/icons/Helicone/HeliconeIcon.jsx lines 1-82, the SVG
component lacks the isDark prop required for theme-aware icons; add isDark to
the component props (e.g., const SvgHelicone = ({ isDark = false, ...props }) =>
...) and replace hard-coded color literals with conditional color variables that
switch based on isDark (use the existing light-mode colors when isDark is false
and appropriate dark-mode fills/strokes when true), then apply those color
variables to each fill and stroke attribute and keep spreading ...props on the
svg element.

Comment on lines -101 to +106
const fuse = new Fuse(validOptions, { keys: ["name", "value"] });
// Prepare Fuse for string-based search over option values.
// validOptions is a string[], so we index under a uniform `value` field.
const fuse = useMemo(() => {
const items = validOptions.map((v) => ({ value: v }));
return new Fuse(items, { keys: ["value"], threshold: 0.3 });
}, [validOptions]);
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

made this change to give users more detailed information about a model in a tooltip

it'll fallback to displaying the model id for most providers

@H2Shami
Copy link
Copy Markdown
Author

H2Shami commented Nov 3, 2025

@coderabbitai help

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 3, 2025

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

CodeRabbit commands

These commands are invoked using PR/Issue comments.

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai evaluate custom pre-merge check --instructions <custom-checks-instructions> --name <custom-checks-title> [--mode <error|warning>] to validate the custom pre-merge checks instructions. Defaults to error when --mode is omitted.
    • @coderabbitai ignore pre-merge checks to override pre-merge checks and get an approval on PR.
    • @coderabbitai run pre-merge checks to run pre-merge checks on the pull request.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve to resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, support, documentation and community

  • Visit our status page to check the current availability of CodeRabbit.
  • Create a ticket on our support page for assistance with any issues or questions.
  • Visit our documentation site for detailed information on how to use CodeRabbit.
  • Join our Discord community to connect with other users and get help from the community.
  • Follow us on X/Twitter for updates and announcements.

@H2Shami
Copy link
Copy Markdown
Author

H2Shami commented Nov 4, 2025

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 4, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@H2Shami H2Shami changed the title integrate helicone as a bundle and as an agent provider feat: integrate helicone as a bundle and as an agent provider Nov 4, 2025
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Nov 4, 2025
@edwinjosechittilappilly
Copy link
Copy Markdown
Collaborator

@H2Shami can you resovle the conflicts?

Copy link
Copy Markdown
Contributor

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 integrates Helicone as both a bundle and an agent provider, enabling Langflow users to access Helicone's AI routing and observability platform with unified access to multiple AI models from different providers.

Key Changes:

  • Added a new HeliconeComponent that fetches available models from Helicone's public API and provides dynamic model selection with rich metadata
  • Integrated Helicone into the model providers list alongside Anthropic, Google Generative AI, and OpenAI
  • Enhanced the frontend dropdown component to properly handle Fuse.js search with string arrays using useMemo for better performance

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/lfx/src/lfx/components/helicone/helicone.py Core Helicone component implementation with model fetching, config updates, and ChatOpenAI integration
src/lfx/src/lfx/components/helicone/__init__.py Dynamic import module for lazy loading of Helicone component
src/lfx/src/lfx/components/__init__.py Registers Helicone module in the components package
src/lfx/src/lfx/base/models/model_input_constants.py Adds Helicone to MODEL_PROVIDERS_DICT and MODEL_PROVIDERS_LIST; changes tool_model_enabled default to False
src/frontend/src/utils/styleUtils.ts Adds Helicone to SIDEBAR_BUNDLES for UI navigation
src/frontend/src/icons/lazyIconImports.ts Registers lazy loading for Helicone icon
src/frontend/src/icons/Helicone/index.tsx React wrapper component for Helicone SVG icon
src/frontend/src/icons/Helicone/helicone.svg SVG source file for Helicone brand icon
src/frontend/src/icons/Helicone/HeliconeIcon.jsx JSX implementation of Helicone icon with SVG paths
src/frontend/src/components/core/dropdownComponent/index.tsx Optimizes Fuse.js initialization with useMemo and proper string array handling
docs/sidebars.js Adds Helicone documentation entry to bundles section
docs/docs/Components/bundles-helicone.mdx Documentation page for Helicone bundle with parameters and usage guide

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +41 to +43
stroke-width="30.1587"
stroke-linecap="round"
stroke-linejoin="round"
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

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

SVG attributes in JSX should use camelCase. Replace stroke-width with strokeWidth and stroke-linecap with strokeLinecap and stroke-linejoin with strokeLinejoin to follow React conventions.

Suggested change
stroke-width="30.1587"
stroke-linecap="round"
stroke-linejoin="round"
strokeWidth="30.1587"
strokeLinecap="round"
strokeLinejoin="round"

Copilot uses AI. Check for mistakes.
Comment on lines +76 to +78
stroke-width="27.4344"
stroke-linecap="round"
stroke-linejoin="round"
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

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

SVG attributes in JSX should use camelCase. Replace stroke-width with strokeWidth and stroke-linecap with strokeLinecap and stroke-linejoin with strokeLinejoin to follow React conventions.

Suggested change
stroke-width="27.4344"
stroke-linecap="round"
stroke-linejoin="round"
strokeWidth="27.4344"
strokeLinecap="round"
strokeLinejoin="round"

Copilot uses AI. Check for mistakes.
>
<path
d="M512.259 82.0808C503.242 78.136 492.988 78.136 483.971 82.0808L75.8928 260.615L403.33 403.869L498.115 445.337L807.242 310.094L920.337 260.615L512.259 82.0808Z"
fill={isDark ? "#F8FEFF" : "#F8FEFF"}
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

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

The ternary operator isDark ? "#F8FEFF" : "#F8FEFF" always returns the same value. Either remove the ternary and use a static fill value, or provide different colors for dark and light modes.

Suggested change
fill={isDark ? "#F8FEFF" : "#F8FEFF"}
fill="#F8FEFF"

Copilot uses AI. Check for mistakes.
"icon": HeliconeComponent.icon,
"is_active": True,
}
except ImportError:
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

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

'except' clause does nothing but pass and there is no explanatory comment.

Copilot uses AI. Check for mistakes.
# components can enable this dynamically when needed.
component_data.advanced = True
component_data.value = True
component_data.value = False
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Has the scope of this been tested? Overall i definitely love this PR and the logic looks great, but im just worried this could cause backwards compat issues with existing users or there's any unintended side effects.

Can you give a thorough justification for the change?

Copy link
Copy Markdown
Author

@H2Shami H2Shami Nov 26, 2025

Choose a reason for hiding this comment

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

you are totally correct, this should not have been changed. thanks for catching

reverted this change and refreshed the component index

Copy link
Copy Markdown
Collaborator

@erichare erichare left a comment

Choose a reason for hiding this comment

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

Great PR but one comment that needs addressing before approval

@erichare
Copy link
Copy Markdown
Collaborator

Please also do resolve the merge conflicts with model_input_constants.py - the component index one can be resolved by taking either the main or your branch's version and then running make build_component_index

@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Nov 26, 2025
@H2Shami H2Shami force-pushed the helicone-integration branch from 6cc45e8 to 8b10f71 Compare November 26, 2025 20:11
@H2Shami H2Shami requested a review from erichare November 26, 2025 20:11
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Nov 26, 2025
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Nov 26, 2025
@H2Shami H2Shami force-pushed the helicone-integration branch from 47638be to 7571ded Compare December 8, 2025 19:17
@H2Shami
Copy link
Copy Markdown
Author

H2Shami commented Dec 8, 2025

hey @erichare!

thanks for the review + positive feedback!

I made the changes, can we get this bad boy in?

@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Dec 8, 2025
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Dec 8, 2025
@erichare erichare removed their request for review March 11, 2026 20:56
@H2Shami H2Shami closed this May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants