Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update node logic #2515

Merged
merged 24 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
254b853
Fixed bug where updating the node does not remove edited status
lucaseduoli Jun 28, 2024
a833702
Fixed order of edited override
lucaseduoli Jun 28, 2024
371b4f8
Made all node-changing functions to alter type the right way
lucaseduoli Jun 28, 2024
9d8811c
Update StoreMessageComponent for enhanced message handling
rodrigosnader Jun 26, 2024
0ab9106
Apply Ruff formatting
rodrigosnader Jun 26, 2024
ccfe8f0
Update StoreMessageComponent for enhanced message handling
rodrigosnader Jun 26, 2024
23991e4
Apply Ruff formatting
rodrigosnader Jun 26, 2024
2b26c5c
Feat: add more types
igorrCarvalho Jun 25, 2024
5828180
Format code
anovazzi1 Jun 27, 2024
b9fa75b
feat: Add CreateListComponent for creating a list of texts
rodrigosnader Jun 28, 2024
2389a82
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 28, 2024
0ca6f2a
Changed native categories to use the keys of the style utils categori…
lucaseduoli Jun 28, 2024
92fa006
change component name
italojohnny Jul 1, 2024
e747b85
Merge remote-tracking branch 'origin/main' into fix/update_node
lucaseduoli Jul 2, 2024
d6e978f
chore: add the name attribute to the CustomComponent
italojohnny Jul 2, 2024
6a277d7
chore: assign the value of name to the components
italojohnny Jul 2, 2024
73a9d71
chore: change the logic of the type value returned
italojohnny Jul 2, 2024
af8a973
chore: extract code to new func
italojohnny Jul 3, 2024
267341a
chore: change component_name value
italojohnny Jul 3, 2024
7fc152c
Merge remote-tracking branch 'origin/main' into fix/update_node
lucaseduoli Jul 3, 2024
278041f
[autofix.ci] apply automated fixes
autofix-ci[bot] Jul 3, 2024
ca91eb2
Formatted files
lucaseduoli Jul 3, 2024
09e4825
Merge branch 'main' into fix/update_node
lucaseduoli Jul 3, 2024
45a98ba
Merge branch 'main' into fix/update_node
lucaseduoli Jul 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: extract code to new func
  • Loading branch information
italojohnny committed Jul 3, 2024
commit af8a9738798d6f8a68bf474b60e922fd09cb577c
6 changes: 2 additions & 4 deletions src/backend/base/langflow/api/v1/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
UploadFileResponse,
)
from langflow.custom.custom_component.component import Component
from langflow.custom.utils import build_custom_component_template
from langflow.custom.utils import build_custom_component_template, get_instance_name
from langflow.graph.graph.base import Graph
from langflow.graph.schema import RunOutputs
from langflow.helpers.flow import get_flow_by_id_or_endpoint_name
Expand Down Expand Up @@ -520,9 +520,7 @@ async def custom_component(
if raw_code.frontend_node is not None:
built_frontend_node = component_instance.post_code_processing(built_frontend_node, raw_code.frontend_node)

_type = component_instance.__class__.__name__
if hasattr(component_instance, 'name') and component_instance.name:
_type = component_instance.name
_type = get_instance_name(component_instance)
return CustomComponentResponse(data=built_frontend_node, type=_type)


Expand Down
7 changes: 7 additions & 0 deletions src/backend/base/langflow/custom/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,3 +554,10 @@ def get_function(code):
function_name = validate.extract_function_name(code)

return validate.create_function(code, function_name)


def get_instance_name(instance):
name = instance.__class__.__name__
if hasattr(instance, 'name') and instance.name:
name = instance.name
return name