feat: integration JigsawStack services into langflow.#8640
feat: integration JigsawStack services into langflow.#8640Khurdhula-Harshavardhan wants to merge 136 commits into
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 WalkthroughThis change introduces a new integration with the JigsawStack API, adding multiple backend components for sentiment analysis, AI web search, web scraping, NSFW detection, text-to-SQL conversion, text translation, and vision OCR. It also adds corresponding frontend icon components and updates the sidebar configuration to include JigsawStack. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant LangflowComponent
participant JigsawStackClient
participant JigsawStackAPI
User->>LangflowComponent: Provide input (e.g., API key, data)
LangflowComponent->>JigsawStackClient: Initialize with API key
LangflowComponent->>JigsawStackAPI: Call specific API (e.g., sentiment, search, scrape, etc.)
JigsawStackAPI-->>JigsawStackClient: Return API response
JigsawStackClient-->>LangflowComponent: Deliver response data
LangflowComponent-->>User: Output structured results or error message
sequenceDiagram
participant User
participant Frontend
participant Sidebar
User->>Frontend: Open sidebar
Frontend->>Sidebar: Render sidebar bundles
Sidebar-->>User: Display "JigsawStack" with icon
✨ 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. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
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: 12
🧹 Nitpick comments (19)
pyproject.toml (1)
176-176: Consider adding an upper bound to thejigsawstackversion.
Pinning only a minimum version (>=0.2.6) can risk unintended breaking changes if a future major release introduces incompatibilities.src/backend/base/langflow/components/jigsawstack/__init__.py (2)
1-6: Sort imports alphabetically.
The import block is unsorted and fails theruffstyle check.
Proposed diff:-from .sentiment import JigsawStackSentimentComponent -from .ai_web_search import JigsawStackAIWebSearchComponent -from .ai_scrape import JigsawStackAIScraperComponent -from .vocr import JigsawStackVOCRComponent -from .nsfw import JigsawStackNSFWComponent -from .text_to_sql import JigsawStackTextToSQLComponent +from .ai_scrape import JigsawStackAIScraperComponent +from .ai_web_search import JigsawStackAIWebSearchComponent +from .nsfw import JigsawStackNSFWComponent +from .sentiment import JigsawStackSentimentComponent +from .text_to_sql import JigsawStackTextToSQLComponent +from .vocr import JigsawStackVOCRComponent
8-15: Sort__all__entries and add a trailing newline.
Ruff reports that__all__is not alphabetized and the file is missing a newline at EOF.
Proposed diff:__all__ = [ - "JigsawStackSentimentComponent", - "JigsawStackAIWebSearchComponent", - "JigsawStackAIScraperComponent", - "JigsawStackVOCRComponent", - "JigsawStackNSFWComponent", - "JigsawStackTextToSQLComponent", + "JigsawStackAIScraperComponent", + "JigsawStackAIWebSearchComponent", + "JigsawStackNSFWComponent", + "JigsawStackSentimentComponent", + "JigsawStackTextToSQLComponent", + "JigsawStackVOCRComponent", +] +src/backend/base/langflow/components/jigsawstack/text_translate.py (2)
61-61: Correct misleading comment.The comment says "Call web scraping" but the code is actually calling translation API.
- # Call web scraping + # Call translation API
1-114: Address code formatting and style issues.The static analysis tools have identified several formatting issues that should be addressed for code consistency:
- Remove unused imports and whitespace in blank lines
- Fix line length violations
- Use constants for exception messages
- Add trailing newline
Apply these formatting fixes:
-from langflow.custom.custom_component.component import Component from langflow.io import Output, SecretStrInput, StrInput, MessageTextInput from langflow.schema.data import Data +from langflow.custom.custom_component.component import Component +# Error messages as constants +JIGSAWSTACK_NOT_FOUND_ERROR = "JigsawStack package not found" +API_UNSUCCESSFUL_ERROR = "JigsawStack API returned unsuccessful response" class JigsawStackTextTranslateComponent(Component): display_name = "Text Translate" description = "Translate text from one language to another with support for multiple text formats." documentation = "https://jigsawstack.com/docs/api-reference/ai/translate" icon = "JigsawStack" name = "JigsawStackTextTranslate" - + inputs = [ SecretStrInput( name="api_key", display_name="JigsawStack API Key", info="Your JigsawStack API key for authentication", required=True, ), StrInput( name="target_language", display_name="Target Language", - info="The language code of the target language to translate to. Language code is identified by a unique ISO 639-1 two-letter code", + info="The language code of the target language to translate to. " + "Language code is identified by a unique ISO 639-1 two-letter code", required=True, ), MessageTextInput( name="text", display_name="Text", - info="The text to translate. This can be a single string or a list of strings. If a list is provided, each string will be translated separately.", + info="The text to translate. This can be a single string or a list of strings. " + "If a list is provided, each string will be translated separately.", required=True, is_list=True ), ] - + outputs = [ Output(display_name="Translation Results", name="translation_results", method="translation"), ] - + def translation(self) -> Data: try: from jigsawstack import JigsawStack except ImportError as e: raise ImportError( - "JigsawStack package not found" + JIGSAWSTACK_NOT_FOUND_ERROR ) from e - + try: client = JigsawStack(api_key=self.api_key) - + #build request object params = {} if self.target_language: params["target_language"] = self.target_language - + if self.text: if isinstance(self.text, list): params["text"] = self.text else: params["text"] = [self.text] - + # Call translation API response = client.translate.text(params) - + if not response.get("success", False): - raise ValueError("JigsawStack API returned unsuccessful response") - + raise ValueError(API_UNSUCCESSFUL_ERROR) + return Data(data=response) - + except Exception as e: error_data = { "error": str(e), "success": False } - self.status = f"Error: {str(e)}" + self.status = f"Error: {e!s}" return Data(data=error_data) - - - +src/backend/base/langflow/components/jigsawstack/nsfw.py (3)
2-2: Remove unused import.
IntInputis imported but never used in this component.-from langflow.io import Output, SecretStrInput, StrInput, IntInput +from langflow.io import Output, SecretStrInput, StrInput
48-48: Correct misleading comment.The comment says "Call web scraping" but the code is actually calling NSFW validation API.
- # Call web scraping + # Call NSFW validation API
1-65: Address formatting and style consistency.Similar to the text translation component, this file has multiple formatting issues that should be addressed for consistency across the JigsawStack components.
The same formatting patterns should be applied here as suggested for the text_translate.py file - removing whitespace in blank lines, using constants for error messages, proper exception handling, and adding trailing newline.
src/backend/base/langflow/components/jigsawstack/sentiment.py (3)
1-1: Remove unused import.
typing.Anyis imported but never used in this component.-from typing import Any - from langflow.custom.custom_component.component import Component
83-84: Fix unused variable and unnecessary f-string prefix.The exception variable
eis assigned but never used, and the f-string doesn't contain any placeholders.- except ImportError as e: - return Message(text=f"Error: JigsawStack package not found. Please install it with: pip install jigsawstack") + except ImportError: + return Message(text="Error: JigsawStack package not found. Please install it with: pip install jigsawstack")
67-67: Consider breaking long status line for readability.The status line exceeds 120 characters. Consider formatting it for better readability.
- self.status = f"Sentiment: {sentiment_data.get('sentiment', 'Unknown')} | Emotion: {sentiment_data.get('emotion', 'Unknown')} | Score: {sentiment_data.get('score', 0.0):.3f}" + sentiment = sentiment_data.get('sentiment', 'Unknown') + emotion = sentiment_data.get('emotion', 'Unknown') + score = sentiment_data.get('score', 0.0) + self.status = f"Sentiment: {sentiment} | Emotion: {emotion} | Score: {score:.3f}"src/backend/base/langflow/components/jigsawstack/ai_web_search.py (2)
1-1: Remove unused imports.Several imports are not used in this component:
typing.Any,MessageTextInput, andDataInput.-from typing import Any - from langflow.custom.custom_component.component import Component -from langflow.io import MessageTextInput, Output, SecretStrInput, BoolInput, DropdownInput, QueryInput, DataInput +from langflow.io import Output, SecretStrInput, BoolInput, DropdownInput, QueryInputAlso applies to: 4-4
70-79: Consider extracting duplicate search parameter logic.The search parameter building logic is duplicated between
search()andget_content_text()methods. Consider extracting this into a private method.+ def _build_search_params(self) -> dict: + """Build search parameters dictionary from component inputs.""" + search_params = {} + if self.query: + search_params["query"] = self.query + if self.ai_overview is not None: + search_params["ai_overview"] = self.ai_overview + if self.safe_search: + search_params["safe_search"] = self.safe_search + if self.spell_check is not None: + search_params["spell_check"] = self.spell_check + return search_params + def search(self) -> Data: try: from jigsawstack import JigsawStack except ImportError as e: raise ImportError( "JigsawStack package not found" ) from e try: client = JigsawStack(api_key=self.api_key) - #build request object - search_params = {} - if self.query: - search_params["query"] = self.query - if self.ai_overview is not None: - search_params["ai_overview"] = self.ai_overview - if self.safe_search: - search_params["safe_search"] = self.safe_search - if self.spell_check is not None: - search_params["spell_check"] = self.spell_check + search_params = self._build_search_params()Apply similar changes to the
get_content_text()method.Also applies to: 119-128
src/backend/base/langflow/components/jigsawstack/ai_scrape.py (3)
1-6: Remove unused imports.Multiple imports are not used:
typing.Any,DataInput,CodeInput, andMessage.-from typing import Any - from langflow.custom.custom_component.component import Component -from langflow.io import MessageTextInput, Output, SecretStrInput, DataInput, StrInput, CodeInput +from langflow.io import MessageTextInput, Output, SecretStrInput, StrInput from langflow.schema.data import Data -from langflow.schema.message import Message
87-87: Replace magic number with named constant.The maximum number of element prompts (5) should be defined as a named constant for better maintainability.
+ MAX_ELEMENT_PROMPTS = 5 + def scrape(self) -> Data: # ... existing code ... - if len(self.element_prompts) > 5: + if len(self.element_prompts) > self.MAX_ELEMENT_PROMPTS: - raise ValueError("Maximum of 5 element prompts allowed") + raise ValueError(f"Maximum of {self.MAX_ELEMENT_PROMPTS} element prompts allowed")
11-11: Break long description line.The description line exceeds 120 characters and should be broken for better readability.
- description = "Scrape any website instantly and get consistent structured data in seconds without writing any css selector code" + description = ("Scrape any website instantly and get consistent structured data " + "in seconds without writing any css selector code")src/backend/base/langflow/components/jigsawstack/vocr.py (1)
11-107: Fix formatting issues to comply with code style guidelines.Multiple formatting issues need to be addressed for consistency with the codebase.
Apply these formatting fixes:
- description = "Extract data from any document type in a consistent structure with fine-tuned vLLMs for the highest accuracy" + description = ( + "Extract data from any document type in a consistent structure with " + "fine-tuned vLLMs for the highest accuracy" + ) documentation = "https://jigsawstack.com/docs/api-reference/ai/vocr" icon = "JigsawStack" name = "JigsawStackVOCR" - + inputs = [Also remove trailing whitespace from blank lines throughout the file and add a trailing newline at the end.
src/backend/base/langflow/components/jigsawstack/text_to_sql.py (2)
35-41: Fix line length violations for better readability.The info strings exceed the 120-character limit and should be wrapped.
- info="The database type to generate SQL for. Supported values are postgresql, mysql, or sqlite. Specifying this parameter improves SQL generation accuracy by applying database-specific syntax and optimizations.", + info=( + "The database type to generate SQL for. Supported values are postgresql, mysql, or sqlite. " + "Specifying this parameter improves SQL generation accuracy by applying database-specific " + "syntax and optimizations." + ), required=False, ), StrInput( name="file_store_key", display_name="File Store Key", - info="The key used to store the database schema on Jigsawstack file Storage. Not required if sql_schema is specified.", + info=( + "The key used to store the database schema on Jigsawstack file Storage. " + "Not required if sql_schema is specified." + ), required=False, )
12-88: Fix formatting issues to comply with code style guidelines.Multiple formatting issues need to be addressed throughout the file, similar to the VOCR component.
Remove trailing whitespace from blank lines (lines 12, 60, 71, 73, 76, 78, 88) and add a trailing newline at the end of the file.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
src/frontend/src/icons/JigsawStack/jigsawstack-icon.svgis excluded by!**/*.svg
📒 Files selected for processing (12)
pyproject.toml(1 hunks)src/backend/base/langflow/components/jigsawstack/__init__.py(1 hunks)src/backend/base/langflow/components/jigsawstack/ai_scrape.py(1 hunks)src/backend/base/langflow/components/jigsawstack/ai_web_search.py(1 hunks)src/backend/base/langflow/components/jigsawstack/nsfw.py(1 hunks)src/backend/base/langflow/components/jigsawstack/sentiment.py(1 hunks)src/backend/base/langflow/components/jigsawstack/text_to_sql.py(1 hunks)src/backend/base/langflow/components/jigsawstack/text_translate.py(1 hunks)src/backend/base/langflow/components/jigsawstack/vocr.py(1 hunks)src/frontend/src/icons/JigsawStack/JigsawStackIcon.jsx(1 hunks)src/frontend/src/icons/JigsawStack/index.tsx(1 hunks)src/frontend/src/utils/styleUtils.ts(1 hunks)
🧰 Additional context used
🪛 Ruff (0.11.9)
src/backend/base/langflow/components/jigsawstack/__init__.py
8-15: __all__ is not sorted
Apply an isort-style sorting to __all__
(RUF022)
15-15: No newline at end of file
Add trailing newline
(W292)
src/backend/base/langflow/components/jigsawstack/ai_scrape.py
1-1: typing.Any imported but unused
Remove unused import: typing.Any
(F401)
4-4: langflow.io.DataInput imported but unused
Remove unused import
(F401)
4-4: langflow.io.CodeInput imported but unused
Remove unused import
(F401)
6-6: langflow.schema.message.Message imported but unused
Remove unused import: langflow.schema.message.Message
(F401)
11-11: Line too long (132 > 120)
(E501)
15-15: Blank line contains whitespace
Remove whitespace from blank line
(W293)
61-63: Avoid specifying long messages outside the exception class
(TRY003)
62-62: Exception must not use a string literal, assign to variable first
Assign to variable; remove string literal
(EM101)
67-67: Blank line contains whitespace
Remove whitespace from blank line
(W293)
76-76: Avoid specifying long messages outside the exception class
(TRY003)
76-76: Exception must not use a string literal, assign to variable first
Assign to variable; remove string literal
(EM101)
77-77: Blank line contains whitespace
Remove whitespace from blank line
(W293)
86-86: Blank line contains whitespace
Remove whitespace from blank line
(W293)
87-87: Magic value used in comparison, consider replacing 5 with a constant variable
(PLR2004)
88-88: Avoid specifying long messages outside the exception class
(TRY003)
88-88: Exception must not use a string literal, assign to variable first
Assign to variable; remove string literal
(EM101)
89-89: Unnecessary elif after raise statement
Remove unnecessary elif
(RET506)
90-90: Avoid specifying long messages outside the exception class
(TRY003)
90-90: Exception must not use a string literal, assign to variable first
Assign to variable; remove string literal
(EM101)
91-91: Blank line contains whitespace
Remove whitespace from blank line
(W293)
95-95: Blank line contains whitespace
Remove whitespace from blank line
(W293)
98-98: Blank line contains whitespace
Remove whitespace from blank line
(W293)
100-100: Avoid specifying long messages outside the exception class
(TRY003)
100-100: Exception must not use a string literal, assign to variable first
Assign to variable; remove string literal
(EM101)
102-102: Trailing whitespace
Remove trailing whitespace
(W291)
103-103: Blank line contains whitespace
Remove whitespace from blank line
(W293)
104-104: f-string without any placeholders
Remove extraneous f prefix
(F541)
105-105: Blank line contains whitespace
Remove whitespace from blank line
(W293)
107-107: Blank line contains whitespace
Remove whitespace from blank line
(W293)
108-108: Do not catch blind exception: Exception
(BLE001)
113-113: Use explicit conversion flag
Replace with conversion flag
(RUF010)
114-114: No newline at end of file
Add trailing newline
(W292)
src/backend/base/langflow/components/jigsawstack/text_translate.py
12-12: Blank line contains whitespace
Remove whitespace from blank line
(W293)
23-23: Line too long (143 > 120)
(E501)
29-29: Line too long (158 > 120)
(E501)
43-45: Avoid specifying long messages outside the exception class
(TRY003)
44-44: Exception must not use a string literal, assign to variable first
Assign to variable; remove string literal
(EM101)
49-49: Blank line contains whitespace
Remove whitespace from blank line
(W293)
60-60: Blank line contains whitespace
Remove whitespace from blank line
(W293)
63-63: Blank line contains whitespace
Remove whitespace from blank line
(W293)
65-65: Avoid specifying long messages outside the exception class
(TRY003)
65-65: Exception must not use a string literal, assign to variable first
Assign to variable; remove string literal
(EM101)
66-66: Blank line contains whitespace
Remove whitespace from blank line
(W293)
68-68: Blank line contains whitespace
Remove whitespace from blank line
(W293)
69-69: Do not catch blind exception: Exception
(BLE001)
74-74: Use explicit conversion flag
Replace with conversion flag
(RUF010)
78-78: Blank line contains whitespace
Remove whitespace from blank line
(W293)
78-78: No newline at end of file
Add trailing newline
(W292)
src/backend/base/langflow/components/jigsawstack/ai_web_search.py
1-1: typing.Any imported but unused
Remove unused import: typing.Any
(F401)
4-4: langflow.io.MessageTextInput imported but unused
Remove unused import
(F401)
4-4: langflow.io.DataInput imported but unused
Remove unused import
(F401)
15-15: Blank line contains whitespace
Remove whitespace from blank line
(W293)
63-65: Avoid specifying long messages outside the exception class
(TRY003)
64-64: Exception must not use a string literal, assign to variable first
Assign to variable; remove string literal
(EM101)
69-69: Blank line contains whitespace
Remove whitespace from blank line
(W293)
80-80: Blank line contains whitespace
Remove whitespace from blank line
(W293)
83-83: Blank line contains whitespace
Remove whitespace from blank line
(W293)
85-85: Avoid specifying long messages outside the exception class
(TRY003)
85-85: Exception must not use a string literal, assign to variable first
Assign to variable; remove string literal
(EM101)
86-86: Blank line contains whitespace
Remove whitespace from blank line
(W293)
96-96: Blank line contains whitespace
Remove whitespace from blank line
(W293)
98-98: Blank line contains whitespace
Remove whitespace from blank line
(W293)
100-100: Blank line contains whitespace
Remove whitespace from blank line
(W293)
101-101: Do not catch blind exception: Exception
(BLE001)
106-106: Use explicit conversion flag
Replace with conversion flag
(RUF010)
112-112: Local variable e is assigned to but never used
Remove assignment to unused variable e
(F841)
113-113: f-string without any placeholders
Remove extraneous f prefix
(F541)
118-118: Blank line contains whitespace
Remove whitespace from blank line
(W293)
128-128: Blank line contains whitespace
Remove whitespace from blank line
(W293)
131-131: Blank line contains whitespace
Remove whitespace from blank line
(W293)
133-133: Avoid specifying long messages outside the exception class
(TRY003)
133-133: Exception must not use a string literal, assign to variable first
Assign to variable; remove string literal
(EM101)
134-134: Blank line contains whitespace
Remove whitespace from blank line
(W293)
138-138: Blank line contains whitespace
Remove whitespace from blank line
(W293)
139-139: Do not catch blind exception: Exception
(BLE001)
140-140: Use explicit conversion flag
Replace with conversion flag
(RUF010)
140-140: No newline at end of file
Add trailing newline
(W292)
src/backend/base/langflow/components/jigsawstack/nsfw.py
2-2: langflow.io.IntInput imported but unused
Remove unused import: langflow.io.IntInput
(F401)
12-12: Blank line contains whitespace
Remove whitespace from blank line
(W293)
36-38: Avoid specifying long messages outside the exception class
(TRY003)
37-37: Exception must not use a string literal, assign to variable first
Assign to variable; remove string literal
(EM101)
42-42: Blank line contains whitespace
Remove whitespace from blank line
(W293)
47-47: Blank line contains whitespace
Remove whitespace from blank line
(W293)
50-50: Blank line contains whitespace
Remove whitespace from blank line
(W293)
52-52: Avoid specifying long messages outside the exception class
(TRY003)
52-52: Exception must not use a string literal, assign to variable first
Assign to variable; remove string literal
(EM101)
53-53: Blank line contains whitespace
Remove whitespace from blank line
(W293)
55-55: Blank line contains whitespace
Remove whitespace from blank line
(W293)
56-56: Do not catch blind exception: Exception
(BLE001)
61-61: Use explicit conversion flag
Replace with conversion flag
(RUF010)
65-65: Blank line contains whitespace
Remove whitespace from blank line
(W293)
65-65: No newline at end of file
Add trailing newline
(W292)
src/backend/base/langflow/components/jigsawstack/sentiment.py
1-1: typing.Any imported but unused
Remove unused import: typing.Any
(F401)
15-15: Blank line contains whitespace
Remove whitespace from blank line
(W293)
41-43: Avoid specifying long messages outside the exception class
(TRY003)
42-42: Exception must not use a string literal, assign to variable first
Assign to variable; remove string literal
(EM101)
48-48: Blank line contains whitespace
Remove whitespace from blank line
(W293)
51-51: Blank line contains whitespace
Remove whitespace from blank line
(W293)
53-53: Avoid specifying long messages outside the exception class
(TRY003)
53-53: Exception must not use a string literal, assign to variable first
Assign to variable; remove string literal
(EM101)
54-54: Blank line contains whitespace
Remove whitespace from blank line
(W293)
56-56: Blank line contains whitespace
Remove whitespace from blank line
(W293)
66-66: Blank line contains whitespace
Remove whitespace from blank line
(W293)
67-67: Line too long (186 > 120)
(E501)
68-68: Blank line contains whitespace
Remove whitespace from blank line
(W293)
70-70: Blank line contains whitespace
Remove whitespace from blank line
(W293)
71-71: Do not catch blind exception: Exception
(BLE001)
77-77: Use explicit conversion flag
Replace with conversion flag
(RUF010)
83-83: Local variable e is assigned to but never used
Remove assignment to unused variable e
(F841)
84-84: f-string without any placeholders
Remove extraneous f prefix
(F541)
84-84: Line too long (121 > 120)
(E501)
89-89: Blank line contains whitespace
Remove whitespace from blank line
(W293)
92-92: Blank line contains whitespace
Remove whitespace from blank line
(W293)
95-95: Blank line contains whitespace
Remove whitespace from blank line
(W293)
97-97: Blank line contains whitespace
Remove whitespace from blank line
(W293)
116-116: Line too long (147 > 120)
(E501)
119-119: Blank line contains whitespace
Remove whitespace from blank line
(W293)
120-120: Do not catch blind exception: Exception
(BLE001)
121-121: Use explicit conversion flag
Replace with conversion flag
(RUF010)
121-121: No newline at end of file
Add trailing newline
(W292)
src/backend/base/langflow/components/jigsawstack/vocr.py
1-1: typing.Any imported but unused
Remove unused import: typing.Any
(F401)
4-4: langflow.io.PromptInput imported but unused
Remove unused import: langflow.io.PromptInput
(F401)
6-6: langflow.schema.message.Message imported but unused
Remove unused import: langflow.schema.message.Message
(F401)
11-11: Line too long (128 > 120)
(E501)
15-15: Blank line contains whitespace
Remove whitespace from blank line
(W293)
65-67: Avoid specifying long messages outside the exception class
(TRY003)
66-66: Exception must not use a string literal, assign to variable first
Assign to variable; remove string literal
(EM101)
71-71: Blank line contains whitespace
Remove whitespace from blank line
(W293)
80-80: Avoid specifying long messages outside the exception class
(TRY003)
80-80: Exception must not use a string literal, assign to variable first
Assign to variable; remove string literal
(EM101)
87-87: Blank line contains whitespace
Remove whitespace from blank line
(W293)
89-89: Blank line contains whitespace
Remove whitespace from blank line
(W293)
92-92: Blank line contains whitespace
Remove whitespace from blank line
(W293)
94-94: Avoid specifying long messages outside the exception class
(TRY003)
94-94: Exception must not use a string literal, assign to variable first
Assign to variable; remove string literal
(EM101)
95-95: Blank line contains whitespace
Remove whitespace from blank line
(W293)
97-97: Blank line contains whitespace
Remove whitespace from blank line
(W293)
98-98: Do not catch blind exception: Exception
(BLE001)
103-103: Use explicit conversion flag
Replace with conversion flag
(RUF010)
107-107: Blank line contains whitespace
Remove whitespace from blank line
(W293)
107-107: No newline at end of file
Add trailing newline
(W292)
src/backend/base/langflow/components/jigsawstack/text_to_sql.py
12-12: Blank line contains whitespace
Remove whitespace from blank line
(W293)
35-35: Line too long (224 > 120)
(E501)
41-41: Line too long (131 > 120)
(E501)
54-56: Avoid specifying long messages outside the exception class
(TRY003)
55-55: Exception must not use a string literal, assign to variable first
Assign to variable; remove string literal
(EM101)
60-60: Blank line contains whitespace
Remove whitespace from blank line
(W293)
71-71: Blank line contains whitespace
Remove whitespace from blank line
(W293)
73-73: Blank line contains whitespace
Remove whitespace from blank line
(W293)
75-75: Avoid specifying long messages outside the exception class
(TRY003)
75-75: Exception must not use a string literal, assign to variable first
Assign to variable; remove string literal
(EM101)
76-76: Blank line contains whitespace
Remove whitespace from blank line
(W293)
78-78: Blank line contains whitespace
Remove whitespace from blank line
(W293)
79-79: Do not catch blind exception: Exception
(BLE001)
84-84: Use explicit conversion flag
Replace with conversion flag
(RUF010)
88-88: Blank line contains whitespace
Remove whitespace from blank line
(W293)
88-88: No newline at end of file
Add trailing newline
(W292)
🪛 GitHub Check: Ruff Style Check (3.13)
src/backend/base/langflow/components/jigsawstack/__init__.py
[failure] 15-15: Ruff (W292)
src/backend/base/langflow/components/jigsawstack/init.py:15:2: W292 No newline at end of file
[failure] 8-15: Ruff (RUF022)
src/backend/base/langflow/components/jigsawstack/init.py:8:11: RUF022 __all__ is not sorted
[failure] 1-6: Ruff (I001)
src/backend/base/langflow/components/jigsawstack/init.py:1:1: I001 Import block is un-sorted or un-formatted
src/backend/base/langflow/components/jigsawstack/ai_scrape.py
[failure] 15-15: Ruff (W293)
src/backend/base/langflow/components/jigsawstack/ai_scrape.py:15:1: W293 Blank line contains whitespace
[failure] 11-11: Ruff (E501)
src/backend/base/langflow/components/jigsawstack/ai_scrape.py:11:121: E501 Line too long (132 > 120)
[failure] 6-6: Ruff (F401)
src/backend/base/langflow/components/jigsawstack/ai_scrape.py:6:37: F401 langflow.schema.message.Message imported but unused
[failure] 4-4: Ruff (F401)
src/backend/base/langflow/components/jigsawstack/ai_scrape.py:4:88: F401 langflow.io.CodeInput imported but unused
[failure] 4-4: Ruff (F401)
src/backend/base/langflow/components/jigsawstack/ai_scrape.py:4:67: F401 langflow.io.DataInput imported but unused
[failure] 1-1: Ruff (F401)
src/backend/base/langflow/components/jigsawstack/ai_scrape.py:1:20: F401 typing.Any imported but unused
[failure] 1-6: Ruff (I001)
src/backend/base/langflow/components/jigsawstack/ai_scrape.py:1:1: I001 Import block is un-sorted or un-formatted
🪛 GitHub Actions: Ruff Style Check
src/backend/base/langflow/components/jigsawstack/__init__.py
[error] 1-1: Ruff: Import block is un-sorted or un-formatted.
🪛 Pylint (3.3.7)
src/backend/base/langflow/components/jigsawstack/ai_scrape.py
[refactor] 87-90: Unnecessary "elif" after "raise", remove the leading "el" from "elif"
(R1720)
[refactor] 57-57: Too many branches (14/12)
(R0912)
[error] 78-78: Access to member 'element_prompts' before its definition line 81
(E0203)
[error] 79-79: Access to member 'element_prompts' before its definition line 81
(E0203)
[error] 80-80: Access to member 'element_prompts' before its definition line 81
(E0203)
🔇 Additional comments (2)
src/frontend/src/utils/styleUtils.ts (1)
287-287: Verify lazy import mapping forJigsawStack.
You’ve added{ display_name: "JigsawStack", name: "jigsawstack", icon: "JigsawStack" }toSIDEBAR_BUNDLES. Ensure thatlazyIconImports(and any eager mappings) include aJigsawStackentry so the icon resolves correctly at runtime.src/frontend/src/icons/JigsawStack/index.tsx (1)
1-13: Component structure looks good.
UsesforwardRef, forwards props and ref correctly, and setsdisplayName. No issues found.
|
@Khurdhula-Harshavardhan can you resolve the conflicts? |
…d/react/shallow to optimize re-renders 📝 (handleRenderComponent/index.tsx): Introduce isLocked state to handle locked flow functionality 📝 (handleRenderComponent/index.tsx): Update tooltip visibility based on isLocked state 📝 (handleRenderComponent/index.tsx): Update handle style based on isLocked state 📝 (PageComponent/index.tsx): Add useShallow import for zustand/react/shallow to optimize re-renders 📝 (PageComponent/index.tsx): Introduce isLocked state to handle locked flow functionality 📝 (PageComponent/index.tsx): Prevent edge click actions when flow is locked 📝 (PageComponent/index.tsx): Disable edge actions when flow is locked 📝 (PageComponent/index.tsx): Update edge actions based on isLocked state 📝 (lock-flow.spec.ts): Add test to simulate deleting edges when flow is locked
…r zustand/react/shallow to optimize re-renders" This reverts commit 9898d1c.
…ngflow-ai#8629) Change nightly to run in UTC time
…angflow-ai#8646) Fixed add button appearing on composio component
…gflow-ai#8767) * 🐛 (chat-view.tsx): fix parameter name from stream_url to _stream_url to improve clarity ✨ (chat-view.tsx): add logic to handle scrolling behavior based on chat history updates and message content changes * ♻️ (chat-view.tsx): refactor updateChat function parameters to remove unused _stream_url parameter and improve code readability
* update templates api keys * Update src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com> * Update src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com> * Update Text Sentiment Analysis.json * cust comp test fix --------- Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com> Co-authored-by: Eric Hare <ericrhare@gmail.com> Co-authored-by: Mike Fortman <michael.fortman@datastax.com>
redirect-link-from-template
* update llm component * template updates * Update SEO Keyword Generator.json
add-note Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Delete Diet abalysis template
* fix-note * remove-oss-language-in-note
* replace-aria-label-with-aria-hidden * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update docs/docs/Concepts/concepts-components.md --------- Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* initial-content * add-faster-instructions-to-readme * link-anchor-and-clone * additional-make-commands * copy-content-to-contributing-repo-file * remove-readme-content * remove extra file * tests-location * makefile-update * cleanup-extra-make-commands * contributing-update * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * move-run-cli * docs-review --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
…angflow-ai#8743) * feat(tests): add Jest configuration and setup for testing environment - Introduced Jest configuration file to set up testing environment with TypeScript support and JSDOM. - Added setupTests.ts for global test configurations, including mocks for ResizeObserver and IntersectionObserver. - Updated package.json and package-lock.json to include Jest and related dependencies. - Implemented utility functions for processing markdown content, including handling tables and <think> tags. - Added comprehensive tests for markdown utility functions to ensure proper functionality. * refactor(makefile): separate frontend commands into a dedicated Makefile - Removed frontend-related targets from the main Makefile and created a new Makefile.frontend to manage frontend-specific commands. - Updated the main Makefile to include a reference to the new frontend Makefile and added a help message for frontend commands. - This restructuring improves organization and clarity for managing backend and frontend build processes.
* revise component overview page * comment out 1.5 piece * reorg * coderabbit --------- Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
* feat: flow_runner cleanup messages table * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * fix lint * lint * fix lint * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
…ai#8790) * Fix the invalid folderId path * log fix
…i#8802) * test: add pyleak for task and event loop block detections * test: add pyleak for task and event loop block detections * ci: add env variables for verbose logging * chore: dummy sleep to shwocase error * chore: dummy sleep to showcase error * chore: remove dummy sleep
…meter render logic (langflow-ai#8493) * fix: enhance dropdown component with refresh button and clean up parameter render logic - Added a refresh button to the dropdown component, improving user interaction. - Refactored parameter render component to remove unnecessary wrapping around the render function. - Updated package-lock.json to remove extraneous dependencies. * [autofix.ci] apply automated fixes * refactor(OutputComponent): replace DropdownMenu with Popover and Command components - Updated OutputComponent to use Popover and Command components for improved UI interaction. - Refactored dropdown logic to enhance accessibility and user experience. - Added a reference for the button to manage focus visibility. * refactor: update Memory Chatbot configuration and remove unused RefreshParameterComponent - Changed display names and output methods in Memory Chatbot JSON configuration for clarity and consistency. - Introduced a new output method for retrieving messages as text. - Removed the RefreshParameterComponent and its references from the parameter render component to streamline the codebase. * refactor: update dropdown component layout for improved styling - Changed the layout classes in the dropdown component to enhance responsiveness and visual consistency. - Adjusted flex properties to ensure proper alignment and spacing based on the presence of filtered metadata. * refactor: streamline dropdown component structure and enhance button functionality - Removed redundant rendering functions for refresh and custom option dialogs, integrating them directly into the dropdown's main structure. - Improved layout and styling for better responsiveness and visual consistency. - Adjusted class names for better alignment and spacing, particularly in relation to filtered metadata. - Ensured the refresh button is consistently displayed based on dialog input conditions. * refactor: enhance dropdown component styling for better readability - Updated text size in dropdown options for improved visibility. - Increased padding in command items for better touch targets and visual consistency. * refactor: adjust dropdown component styling for improved usability - Reduced padding in the search input for a more compact design. - Updated text size in the search input for better readability. - Enhanced layout of filtered metadata display for clearer visibility. * refactor: enhance dropdown component rendering and styling - Added console log for filtered metadata to assist in debugging. - Adjusted class names in dropdown options for better responsiveness based on filtered metadata length. * feat: add data-testid attributes for refresh buttons and simplify memoization in ParameterRenderComponent - Added data-testid attributes to refresh buttons in Dropdown component for improved testability. - Removed unnecessary useMemo in ParameterRenderComponent to streamline rendering logic. - Introduced a new test for the refresh dropdown list functionality to ensure proper behavior. --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
✨ (frontend): add CustomTermsLinks component to GeneralPage to display custom terms links in the settings page.
|
@edwinjosechittilappilly These conflicts are getting complicated. May I please create a new PR and close this for simplicity? Please let me know. Thanks. |
|
Hi @edwinjosechittilappilly, |
This pull request integrates the
jigsawstacklibrary into the project and introduces several new components leveraging its capabilities.Dependency Addition:
jigsawstack>=0.2.6to thedevdependencies inpyproject.toml. This library enables AI-powered functionalities such as web scraping, sentiment analysis, and text translation.New Components:
Web Scraping and Search:
JigsawStackAIScraperComponent: Implements AI-powered web scraping to extract structured data from websites without requiring CSS selectors.JigsawStackAIWebSearchComponent: Provides AI-enhanced web search functionality, including safe search options and spell-checking.AI Analysis:
JigsawStackSentimentComponent: Enables sentiment and emotion analysis of text, providing detailed sentence-by-sentence breakdowns.JigsawStackNSFWComponent: Detects NSFW content in images, such as nudity and violence.Text Processing:
JigsawStackTextToSQLComponent: Converts natural language prompts into SQL queries for various database types.JigsawStackTextTranslateComponent: Translates text between languages, supporting multiple formats and ISO 639-1 language codes.Component Registration:
src/backend/base/langflow/components/jigsawstack/__init__.pyfor centralized access and management.Summary by CodeRabbit
New Features
Chores