feat: Add CometAPI Integration as bundles#9629
Conversation
- Add CometAPI model component with OpenAI-compatible API - Support 30+ models including GPT-5, Claude 4.1, Gemini 2.5, Grok 4, DeepSeek v3.1 - Add frontend icons and component registration - Register COMETAPI_API_KEY environment variable - Add proper lazy loading and dynamic imports
- Add CometAPI model component with OpenAI-compatible API - Support for GPT, Claude, Gemini, Grok, DeepSeek, Qwen models - Add combobox support for model selection (dropdown + custom input) - Create comprehensive documentation for CometAPI bundle - Add CometAPI icon and frontend integration - Fix component validation issues
feat: add CometAPI integration as bundles
|
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 WalkthroughAdds a new CometAPI LLM component with lazy import, remote model discovery, and LangChain ChatOpenAI integration; introduces supported model constants and environment variable; updates frontend with a CometAPI bundle and icon; and adds documentation and sidebar entry for the new component. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor U as User
participant FE as Frontend (Langflow UI)
participant BE as Backend (CometAPI Component)
participant CA as CometAPI API
participant LC as LangChain ChatOpenAI
rect rgb(244,248,253)
note over FE,BE: Model list discovery (on API key/model field change)
U->>FE: Open CometAPI component
FE->>BE: Request model options (api_key)
BE->>CA: GET /models (Bearer api_key)
alt Success
CA-->>BE: 200 JSON (model ids)
BE-->>FE: Updated model options
else Error
BE-->>FE: Fallback to local constants
end
end
rect rgb(245,253,247)
note over FE,BE: Text generation
U->>FE: Run flow with prompt/config
FE->>BE: Build and invoke model
BE->>LC: Init ChatOpenAI (base_url=CometAPI, api_key, params)
LC-->>BE: Model ready
BE->>LC: Invoke(prompt[, stream/json])
LC-->>BE: Response
BE-->>FE: Model Response / Language Model output
FE-->>U: Display output
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
|
Hi! I'm I would like to apply some automated changes to this pull request, but it looks like I don't have the necessary permissions to do so. To get this pull request into a mergeable state, please do one of the following two things:
|
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (14)
src/frontend/src/icons/CometAPI/cometapi.jsx (2)
1-1: Consider TS + explicit props typingMigrate to TSX with a typed props interface to align with “Use React 18 with TypeScript” guidance.
Example:
-const SvgCometAPI = ({ isDark = false, ...props }) => ( +import type { SVGProps } from "react"; +type Props = SVGProps<SVGSVGElement> & { isDark?: boolean }; +const SvgCometAPI = ({ isDark = false, ...props }: Props) => (
2-9: Minor a11y: add focusable="false" or titleSVGs used decoratively should be focusable={false} (and aria-hidden) or provide a <title>. You already added aria-label above; alternatively mark decorative.
- <svg + <svg + focusable="false"src/backend/base/langflow/base/models/cometapi_constants.py (1)
2-41: Ensure COMETAPI_MODELS is in sync with the live API
SetCOMETAPI_API_KEYin your environment and re-run the diff script from the original comment to compare the staticCOMETAPI_MODELSlist against the live/modelsendpoint—update any stale or missing entries. Continue using this list only as a fallback and consider loading a curated subset while fetching the full list at runtime.src/backend/base/langflow/components/cometapi/cometapi.py (4)
92-99: Harden JSON parsing against schema variance and keep status informativeHandle responses where models come as an array of strings or objects with “name”.
- model_list = response.json() - return [model["id"] for model in model_list.get("data", [])] + payload = response.json() + items = payload.get("data", payload) # accept either {data: [...]} or [...] + models: list[str] = [] + for item in items or []: + if isinstance(item, dict): + models.append(item.get("id") or item.get("name") or "") + elif isinstance(item, str): + models.append(item) + return [m for m in models if m] except requests.RequestException as e: self.status = f"Error fetching models: {e}" return MODEL_NAMES
101-106: Avoid fetching on every keystroke in the comboboxupdate_build_config fires on model_name value changes; this will call the API repeatedly while the user types. Limit fetches to API key changes and an explicit refresh action.
Can you confirm the event name/value emitted by the refresh_button for DropdownInput? If it’s distinct, gate the fetch on that event; otherwise, at minimum restrict to field_name == "api_key" and debounce refreshes on the frontend.
132-135: Gate JSON mode to models that support response_formatSome non-OpenAI-compatible models may reject response_format. Consider a capability check or allow users to override via model_kwargs without forcing bind.
If CometAPI marks JSON-mode support in /models, use it to conditionally bind. Otherwise, document that json_mode requires models with OpenAI-style JSON responses.
83-127: Optional: switch to httpx and async to avoid blockingrequests blocks the worker thread. If update_build_config is in an async path, prefer httpx.AsyncClient with timeouts and cancellation handling.
I can provide an async httpx variant of get_models and adapt update_build_config if you confirm the execution context.
src/backend/base/langflow/components/cometapi/__init__.py (2)
17-28: Harden lazy import when spec is None (rare, but safe).Minor defensive fix to avoid edge cases in unusual import contexts.
- result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent) + package = __spec__.parent if __spec__ else __name__ + result = import_mod(attr_name, _dynamic_imports[attr_name], package)
10-16: Keep _dynamic_imports and all alphabetized.For consistency with other component packages.
src/frontend/src/icons/CometAPI/index.tsx (1)
5-10: Support dark mode explicitly via isDark and wire through types.Current wrapper forwards props, but typing doesn’t advertise isDark. Also ensure SvgCometAPI uses isDark to adapt colors.
Type the prop and pass through:
-import type React from "react"; -import { forwardRef } from "react"; -import SvgCometAPI from "./cometapi"; - -export const CometAPIIcon = forwardRef< - SVGSVGElement, - React.PropsWithChildren<{}> ->((props, ref) => { - return <SvgCometAPI ref={ref} {...props} />; -}); +import type React from "react"; +import { forwardRef } from "react"; +import SvgCometAPI from "./cometapi"; + +type Props = React.PropsWithChildren<{ isDark?: boolean }> & React.SVGProps<SVGSVGElement>; + +export const CometAPIIcon = forwardRef<SVGSVGElement, Props>((props, ref) => { + return <SvgCometAPI ref={ref} {...props} />; +});And in src/frontend/src/icons/CometAPI/cometapi.jsx, consume isDark (example):
-const SvgCometAPI = (props) => ( - <svg ... {...props}> - <path fill="#00ACE2" ... /> - <path fill="#0274C3" ... /> - <path fill="#FAFDFE" ... /> - <path fill="#FCFDFE" ... /> - </svg> -); +const SvgCometAPI = ({ isDark = false, ...props }) => { + const accent = isDark ? "#00C1FF" : "#00ACE2"; + const primary = isDark ? "#5BA7F0" : "#0274C3"; + const light1 = isDark ? "#E7F7FF" : "#FAFDFE"; + const light2 = isDark ? "#F2FAFF" : "#FCFDFE"; + return ( + <svg {...props}> + <path fill={accent} ... /> + <path fill={primary} ... /> + <path fill={light1} ... /> + <path fill={light2} ... /> + </svg> + ); +};docs/docs/Components/bundles-cometapi.mdx (4)
26-28: Micro: tighten controls sentence.Apply:
-You can toggle parameters through the <Icon name="SlidersHorizontal" aria-hidden="true"/> **Controls** in the [component's header menu](/concepts-components#component-menus). +Toggle parameters from the <Icon name="SlidersHorizontal" aria-hidden="true"/> **Controls** in the [Component header menu](/concepts-components#component-menus).
55-56: Call out dynamic fetch requirements.Mention the need for a valid key and network access.
Apply:
-The component automatically fetches the latest available models from CometAPI when you provide a valid API key. +The Component automatically fetches the latest available models from CometAPI after you provide a valid API key (requires network access).
66-76: Header case and UI naming consistency.Apply:
-### Example Usage +### Example usage @@ -5. Test your flow in the Playground +5. Test your Flow in the **Playground**.
44-55: Docs: Make CometAPI model list illustrative and fix header caseUse sentence-case header; format model IDs as inline code and add a runtime-availability tip. Backend constants are at src/backend/base/langflow/base/models/cometapi_constants.py (COMETAPI_MODELS / MODEL_NAMES) and referenced by src/backend/base/langflow/components/cometapi/cometapi.py — several IDs include date suffixes, so keep the docs illustrative (examples), not authoritative.
-### Supported Models +### Supported models @@ -CometAPI provides access to a wide range of state-of-the-art language models including: +CometAPI provides access to many state‑of‑the‑art language models. Examples include: @@ -- **GPT Series**: gpt-5-chat-latest, chatgpt-4o-latest, gpt-4o-mini, and more -- **Claude Series**: claude-opus-4-1, claude-sonnet-4, claude-3-5-haiku-latest, and more -- **Gemini Series**: gemini-2.5-pro, gemini-2.5-flash, gemini-2.0-flash -- **Grok Series**: grok-4-0709, grok-3, grok-3-mini -- **DeepSeek Series**: deepseek-v3.1, deepseek-chat, deepseek-reasoner -- **Qwen Series**: qwen3-30b-a3b, qwen3-coder-plus +- **GPT series**: `gpt-5-chat-latest`, `chatgpt-4o-latest`, `gpt-4o-mini` +- **Claude series**: `claude-opus-4-1`, `claude-sonnet-4`, `claude-3-5-haiku-latest` +- **Gemini series**: `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-2.0-flash` +- **Grok series**: `grok-4-0709`, `grok-3`, `grok-3-mini` +- **DeepSeek series**: `deepseek-v3.1`, `deepseek-chat`, `deepseek-reasoner` +- **Qwen series**: `qwen3-30b-a3b`, `qwen3-coder-plus`Add a note:
+:::tip +Actual availability and model IDs vary. The Component fetches the latest list from CometAPI at run time. +:::
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
src/frontend/src/icons/CometAPI/cometapi.svgis excluded by!**/*.svg
📒 Files selected for processing (10)
docs/docs/Components/bundles-cometapi.mdx(1 hunks)docs/sidebars.js(1 hunks)src/backend/base/langflow/base/models/cometapi_constants.py(1 hunks)src/backend/base/langflow/components/cometapi/__init__.py(1 hunks)src/backend/base/langflow/components/cometapi/cometapi.py(1 hunks)src/backend/base/langflow/services/settings/constants.py(1 hunks)src/frontend/src/icons/CometAPI/cometapi.jsx(1 hunks)src/frontend/src/icons/CometAPI/index.tsx(1 hunks)src/frontend/src/icons/lazyIconImports.ts(1 hunks)src/frontend/src/utils/styleUtils.ts(2 hunks)
🧰 Additional context used
📓 Path-based instructions (12)
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/lazyIconImports.tssrc/frontend/src/utils/styleUtils.tssrc/frontend/src/icons/CometAPI/index.tsxsrc/frontend/src/icons/CometAPI/cometapi.jsx
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/lazyIconImports.tssrc/frontend/src/icons/CometAPI/index.tsxsrc/frontend/src/icons/CometAPI/cometapi.jsx
src/frontend/src/icons/lazyIconImports.ts
📄 CodeRabbit inference engine (.cursor/rules/icons.mdc)
Add your icon to the
lazyIconsMappingobject insrc/frontend/src/icons/lazyIconImports.tswith a key that matches the backend icon string exactly.
Files:
src/frontend/src/icons/lazyIconImports.ts
docs/sidebars.js
📄 CodeRabbit inference engine (.cursor/rules/docs_development.mdc)
Sidebar navigation must be updated in docs/sidebars.js to reflect new or reorganized documentation content.
Files:
docs/sidebars.js
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/docs/**/*.{md,mdx}
📄 CodeRabbit inference engine (.cursor/rules/docs_development.mdc)
docs/docs/**/*.{md,mdx}: All documentation content must be written in Markdown or MDX files located under docs/docs/, following the prescribed directory structure for guides, reference, how-to, concepts, and API documentation.
All documentation Markdown and MDX files must begin with a frontmatter block including at least title and description fields.
Use admonitions (:::tip, :::warning, :::danger) in Markdown/MDX files to highlight important information, warnings, or critical issues.
All images referenced in documentation must include descriptive alt text for accessibility.
All code examples included in documentation must be tested and verified to work as shown.
Internal links in documentation must be functional and not broken.
Content must follow the style guide: professional but approachable tone, second person voice, present tense, short paragraphs, sentence case headers, inline code with backticks, bold for UI elements, italic for emphasis, and parallel structure in lists.
Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.
Files:
docs/docs/Components/bundles-cometapi.mdx
src/backend/base/langflow/components/**/*.py
📄 CodeRabbit inference engine (.cursor/rules/backend_development.mdc)
src/backend/base/langflow/components/**/*.py: Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
Implement async component methods using async def and await for asynchronous operations
Use asyncio.create_task for background work in async components and ensure proper cleanup on cancellation
Use asyncio.Queue for non-blocking queue operations in async components and handle timeouts appropriately
Files:
src/backend/base/langflow/components/cometapi/__init__.pysrc/backend/base/langflow/components/cometapi/cometapi.py
src/backend/base/langflow/components/**/__init__.py
📄 CodeRabbit inference engine (.cursor/rules/backend_development.mdc)
Update init.py with alphabetical imports when adding new components
Files:
src/backend/base/langflow/components/cometapi/__init__.py
{src/backend/**/*.py,tests/**/*.py,Makefile}
📄 CodeRabbit inference engine (.cursor/rules/backend_development.mdc)
{src/backend/**/*.py,tests/**/*.py,Makefile}: Run make format_backend to format Python code before linting or committing changes
Run make lint to perform linting checks on backend Python code
Files:
src/backend/base/langflow/components/cometapi/__init__.pysrc/backend/base/langflow/services/settings/constants.pysrc/backend/base/langflow/base/models/cometapi_constants.pysrc/backend/base/langflow/components/cometapi/cometapi.py
src/backend/**/components/**/*.py
📄 CodeRabbit inference engine (.cursor/rules/icons.mdc)
In your Python component class, set the
iconattribute to a string matching the frontend icon mapping exactly (case-sensitive).
Files:
src/backend/base/langflow/components/cometapi/__init__.pysrc/backend/base/langflow/components/cometapi/cometapi.py
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 theisDarkprop to support both light and dark mode.
Files:
src/frontend/src/icons/CometAPI/index.tsxsrc/frontend/src/icons/CometAPI/cometapi.jsx
src/frontend/src/icons/*/index.tsx
📄 CodeRabbit inference engine (.cursor/rules/icons.mdc)
Create an
index.tsxin your icon directory that exports your icon usingforwardRefand passes theisDarkprop.
Files:
src/frontend/src/icons/CometAPI/index.tsx
🧠 Learnings (8)
📚 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-07-18T18:26:42.027Z
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.027Z
Learning: Applies to docs/sidebars.js : Sidebar navigation must be updated in docs/sidebars.js to reflect new or reorganized documentation content.
Applied to files:
docs/sidebars.js
📚 Learning: 2025-07-18T18:25:54.486Z
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.486Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Applied to files:
src/backend/base/langflow/components/cometapi/__init__.py
📚 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/CometAPI/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/CometAPI/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/CometAPI/index.tsx
📚 Learning: 2025-07-18T18:27:12.609Z
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/src/icons/**/*.{ts,tsx,js,jsx} : Use Lucide React for icons in the frontend.
Applied to files:
src/frontend/src/icons/CometAPI/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/*/*.@(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/CometAPI/index.tsxsrc/frontend/src/icons/CometAPI/cometapi.jsx
🧬 Code graph analysis (3)
src/backend/base/langflow/components/cometapi/__init__.py (2)
src/backend/base/langflow/components/_importing.py (1)
import_mod(8-37)src/backend/base/langflow/components/cometapi/cometapi.py (1)
CometAPIModelComponent(21-135)
src/backend/base/langflow/components/cometapi/cometapi.py (2)
src/backend/base/langflow/base/models/model.py (1)
LCModelComponent(25-375)src/backend/base/langflow/inputs/inputs.py (7)
BoolInput(413-425)DictInput(449-464)DropdownInput(467-491)IntInput(343-375)SecretStrInput(285-340)SliderInput(643-644)HandleInput(76-87)
src/frontend/src/icons/CometAPI/index.tsx (1)
src/frontend/src/icons/CometAPI/cometapi.jsx (1)
SvgCometAPI(1-27)
🪛 LanguageTool
docs/docs/Components/bundles-cometapi.mdx
[grammar] ~48-~48: There might be a mistake here.
Context: ...chatgpt-4o-latest, gpt-4o-mini, and more - Claude Series: claude-opus-4-1, claude...
(QB_NEW_EN)
[grammar] ~49-~49: There might be a mistake here.
Context: ...net-4, claude-3-5-haiku-latest, and more - Gemini Series: gemini-2.5-pro, gemini-...
(QB_NEW_EN)
[grammar] ~50-~50: There might be a mistake here.
Context: ...-pro, gemini-2.5-flash, gemini-2.0-flash - Grok Series: grok-4-0709, grok-3, grok...
(QB_NEW_EN)
[grammar] ~51-~51: There might be a mistake here.
Context: ...ries**: grok-4-0709, grok-3, grok-3-mini - DeepSeek Series: deepseek-v3.1, deepse...
(QB_NEW_EN)
[grammar] ~52-~52: There might be a mistake here.
Context: ...k-v3.1, deepseek-chat, deepseek-reasoner - Qwen Series: qwen3-30b-a3b, qwen3-code...
(QB_NEW_EN)
⏰ 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). (52)
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 38/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 39/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 40/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 37/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 34/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 33/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 28/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 31/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 30/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 29/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 26/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 25/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 27/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 35/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 32/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 36/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 24/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 23/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 21/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 22/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 19/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 17/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 18/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 20/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 15/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 16/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 13/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 10/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 6/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 14/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 9/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 12/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 7/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 3/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 11/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 8/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 5/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 2/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 4/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 1/40
- GitHub Check: Test Docs Build / Test Docs Build
- GitHub Check: Lint Backend / Run Mypy (3.13)
- GitHub Check: Run Frontend Unit Tests / Frontend Jest Unit Tests
- 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 4
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 3
- 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 Starter Templates
- GitHub Check: Update Starter Projects
- GitHub Check: Optimize new Python code in this PR
🔇 Additional comments (10)
src/backend/base/langflow/services/settings/constants.py (1)
31-31: LGTM: add COMETAPI_API_KEY to env allowlistMatches SecretStrInput default in the new component and enables real-time env loading.
src/backend/base/langflow/components/cometapi/cometapi.py (1)
1-1: No action needed: ‘requests’ is already included in backend dependenciesdocs/sidebars.js (1)
301-302: Verified: bothbundles-cometapi.mdxandbundles-cohere.mdxexist and match sidebar references.src/frontend/src/icons/lazyIconImports.ts (1)
56-57: LGTM — icon key matches backend icon string ("CometAPI").This aligns with CometAPIModelComponent.icon.
src/frontend/src/utils/styleUtils.ts (2)
261-262: LGTM — CometAPI bundle added to sidebar.Placement next to other “C*” bundles keeps ordering coherent.
423-424: LGTM — Node-to-icon map includes CometAPIModelComponent.Matches backend class name and icon.
docs/docs/Components/bundles-cometapi.mdx (4)
31-36: The search will run; I’ll update once we know howmax_tokensis handled.
8-13: Verify the internal link and tighten the intro.
- Use second-person voice and consistent capitalization. Apply:
-[Bundles](/components-bundle-components) contain custom components that support specific third-party integrations with Langflow. +[Bundles](/components-bundle-components) contain custom Components that integrate third-party services with Langflow. -This page describes the components that are available in the **CometAPI** bundle. +This page describes the Components available in the **CometAPI** bundle. -For more information about CometAPI features and functionality used by CometAPI components, see the [CometAPI documentation](https://www.cometapi.com/). +For more information about CometAPI features used by these Components, see the [CometAPI documentation](https://www.cometapi.com/).
- Verify that the
/components-bundle-componentspage exists (or update the slug to the correct path).
29-43: Standardize parameter table formatting and verify backend behavior
- Wrap types and literals in backticks, use “ID” (not “id”), and normalize boolean defaults to
false.- Confirm that
max_tokens = 0truly disables the token limit and thatjson_modeforces JSON output in the CometAPI backend.
16-23: Ignore anchor-id change
The suggestion to update the link to/data-types#language-modelis incorrect—retain/data-types#languagemodelto match the## LanguageModelheading.Likely an incorrect or invalid review comment.
- Improve error handling with specific exception types - Add proper logging for better debugging - Extract constants for API URL and timeout - Add type annotations and docstrings - Fix code structure issues identified by ruff - Remove trailing whitespace
refactor: optimize CometAPI code based on AI review feedback
- Add noqa comment to suppress TRY300 rule conflict - Fix code structure for better readability - Ensure all linting checks pass
fix: resolve TRY300 linting issue in CometAPI component
|


This PR adds support for CometAPI, a unified API platform that provides access to 500+ AI models including GPT, Claude, Gemini, Grok, DeepSeek, and Qwen series models.
What's Changed
Usage
CometAPI provides unified access to the latest AI models through a single API, making it easier to experiment with different model providers.
Summary by CodeRabbit
New Features
Documentation
Chores