langflow icon indicating copy to clipboard operation
langflow copied to clipboard

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

Open H2Shami opened this issue 2 months ago • 5 comments

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.

H2Shami avatar Oct 28 '25 22:10 H2Shami

[!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

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

  • langflow-ai/langflow#8824 — overlaps editing of SIDEBAR_BUNDLES in src/frontend/src/utils/styleUtils.ts (potential merge overlap).

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.

coderabbitai[bot] avatar Oct 28 '25 22:10 coderabbitai[bot]

@coderabbitai help

H2Shami avatar Nov 03 '25 20:11 H2Shami

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.

coderabbitai[bot] avatar Nov 03 '25 20:11 coderabbitai[bot]

@coderabbitai review

H2Shami avatar Nov 04 '25 00:11 H2Shami

✅ 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.

coderabbitai[bot] avatar Nov 04 '25 00:11 coderabbitai[bot]

@H2Shami can you resovle the conflicts?

edwinjosechittilappilly avatar Nov 21 '25 17:11 edwinjosechittilappilly

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

erichare avatar Nov 24 '25 16:11 erichare